TL: DR - How can I make Cucumber request a page through an application, but pretend the request came from "http://mysubdomain.mydomain.dev" and run javascript correctly?
Ok, it may take some time to explain, but please carry me ...
I am a "relatively" experienced Rails developer, but only recently plunged into a full-fledged BDD / TDD.
The page I'm testing in a cucumber contains some javascript to create a new nested object (very similar to this RailsCast ).
Now the problem is that I have not only variable subdomains, but also variable Domains (just trust me on this ...)
Therefore, the application must query request.hostto find current_domainand current_subdomainbefore everything communicates in the background, and it can continue to serve the desired bits of the application.
I managed to get all the tests passing perfectly using the methods host! domainand Capybara.default_host = domainin the background steps.
However, when I use the @javascript tag for a function that checks the page using .js, I get Firefox focus and then try to load the full URL.
Now it also happens that I run Pow and bind these URLs to the dev server. Not surprisingly, they do not work when a user tries to log in by looking in Dev DB. I tried to start the package after turning off the pow server, and it is just timed.
, - javascript URL-, , - , .
- . Cucumber , , "http://mysubdomain.mydomain.dev"?
: Jason - , ... db request.subdomains.first, request.domain. , , .., URL-, , , , db ...
Oh - ...
, , .. PaaS - , .