0

My named routes are being calculated as www.example.com/<route>. Why is the www.example.com domain being used? This breaks selenium tests where a browser is opened because the browser is attempting to access www.example.com/sports, which obviously doesn't exist.

If I used the paths instead of url (sports_path instead of sports_url), things work fine. It's only my named url routes that is throwing in the www.example.com domain.

Tyler DeWitt
  • 23,366
  • 38
  • 119
  • 196
  • Normally this only occurs in mailer views but try adding `config.action_mailer.default_url_options = { host: 'localhost:3000' }` to your `test.rb` environment file and see if it works for non-mailer views as well. edit: I forgot to add that this actually shouldn't be necessary, I'm just throwing out an idea. Your problem might be related to selenium. – James Mar 14 '12 at 17:20
  • Thanks for the idea. I had configured the action_mailer in the development and production sites. I added that line to test.rb with no change in behavior. – Tyler DeWitt Mar 14 '12 at 17:45
  • @tharrison - I don't know how to mark this as a duplicate, but if you want to put that as an answer I can accept it to close this out. Thanks – Tyler DeWitt Mar 15 '12 at 16:25

0 Answers0