Rails Test Environment Named Routes

I noticed that when I run tests (using Rspec and spork, if that matters), my hostname is set to www.example.com. Therefore, if I do this:

visit sports_url 

the test will indeed go to www.example.com/sports.

This is a problem because I need to run some tests with selenium (to get javascript support). In addition, I noticed that my letters are sent from www.example.com.

What have I messed up? Why does the test environment work like example.com? Can I customize this somewhere? I assume that it should be software (depending on which port starts the test server).

0
source share
1 answer

You can configure the domain of the test environment, and then configure the DNS to perform the necessary actions.

How to change the default "www.example.com" domain for testing in rails?

0
source

Source: https://habr.com/ru/post/1401285/


All Articles