Rails, Cucumber: external redirection to another domain
-
29-09-2019 - |
Question
I have cucumber feature
...
Given I am on my domain page
When I press "send data to external domain"
Then I should be on the externel domain page
...
In production and development enviroments "My domain page" (www.example.com/mydomainpage) redirects user to "external domain page" (www.externaldomain.com/page). But in test enviroment cucumber cut off domain part of url:
Redirected to http://www.externaldomain.com/page
Completed 302 Found in 17895ms
Started GET "/page" for 127.0.0.1 at 2010-10-11 19:06:48 +0400
SQL (72.0ms) ROLLBACK
Is it possible to set up cucumber to redirect to various domain, not only current server domain?
P.S. Cucumber + Capybara + Rails + Rspec
Solution
There are many ways to do such thing (Selenium, Culerity and etc...). Best way is using capybara-mechanize, the RackTest driver for Capybara with remote request support. This is very cool tool!
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow