What should I default_url_options[:host] for integration testing, if using Pow?

304 views Asked by At

I'm using Pow to serve up my development environment. In my config/environments/development.rb and test.rb files, I had this line:

Rails.application.routes.default_url_options[:host] = "myapp.dev"

But of course that doesn't work, because then my RSpec/Capy integration test run against the development database and don't match the factory data.

Why does this even matter? I thought the testing suite spun up its own Rack server. Since it does appear to matter, to what do I set it?

1

There are 1 answers

2
Bart On BEST ANSWER

Change the port in your spec_helper.rb for starters, as you're apparently running tests in your development environment.

Capybara.run_server = true 
Capybara.server_port = 7000
Capybara.app_host = "http://localhost:#{Capybara.server_port}"