ruby-on-rails – 黄瓜水豚:一个将浏览器重定向到我的应用程序之外的场景的问题

Given I have a rails app
And I'm using cucumber
And I'm using capybara
And I have an action that results in a redirect_to "http://some.other.domain.com/some_path"
When I test this action
Then the in-app portion of the test works fine
But I see this error: No route matches "/some_path" with {:method=>:get} (ActionController::RoutingError)

所以capybara被正确重定向到“http://some.other.domain.com/some_path”,但由于某种原因,它认为它应该处理我的应用程序内的URL的路径部分.注意capybara没有任何问题,“http://some.other.domain.com/” – 我的测试通过,如果我重定向到没有路径部分的URL.

这是一个bug吗?

解决方法

你使用哪个司机?机架测试驱动程序不会允许您从其他域请求内容.如果Capybara正在用硒或Culerity这样做,那肯定是一个bug.如果你想帮助解决它,修改一个失败的规格将非常感谢:)

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...