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.如果你想帮助解决它,修改一个失败的规格将非常感谢:)