RubyRedGrapefruit
RubyRedGrapefruit

Reputation: 12224

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

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?

Upvotes: 0

Views: 304

Answers (1)

Bart
Bart

Reputation: 2656

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}" 

Upvotes: 1

Related Questions