Rails、Cucumber:外部重定向到另一个域
我有黄瓜功能
...
Given I am on my domain page
When I press "send data to external domain"
Then I should be on the externel domain page
...
在生产和开发环境中“我的域页面”(www.example.com/mydomainpage)将用户重定向到“外部域页面”(www.externaldomain.com/page)。但是在测试环境中,cucumber 切断了 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
是否可以设置 cucumber 重定向到各种域,而不仅仅是当前服务器域?
PS 黄瓜 + 水豚 + Rails + Rspec
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有很多方法可以做到这一点(Selenium、Culerity 等)。最好的方法是使用 capybara-mechanize,这是具有远程请求支持的 Capybara 的 RackTest 驱动程序。这是非常酷的工具!
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!