加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

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

发布时间:2020-12-16 19:40:10 所属栏目:百科 来源:网络整理
导读:Given I have a rails appAnd I'm using cucumberAnd I'm using capybaraAnd I have an action that results in a redirect_to "http://some.other.domain.com/some_path"When I test this actionThen the in-app portion of the test works fineBut I see t
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.如果你想帮助解决它,修改一个失败的规格将非常感谢:)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读