Apparently, while running tests in Rails, the hostname is “www.example.com”. If I run root_url in a test it’ll return “http://www.example.com/”.
Since I’m doing an app that requires another hostnames, is there a way to change the default hostname to something else, so I don’t have to specify it every time I generate a URL in the tests?
Thanks.
It seems the answer is no, in the test code, you have to specify the host when calling url helpers.