Capybara :: InfiniteRedirectError - 通过rails 3.2.12集成测试中的click_link

时间:2013-04-20 20:53:39

标签: ruby-on-rails rspec capybara integration-testing

这是与capybara的rails集成测试中的一段代码:

it "should work with links on index page" do
      visit customers_path
      save_and_open_page
      click_link 'Edit'
end

显示的html页面是:

enter image description here

页面中有一个编辑链接。但是,click_link'Edit'仍会抛出错误:

 1) TestPaths GET /customerx_test_paths should work with links on index page
     ←[31mFailure/Error:←[0m ←[31mclick_link 'Edit'←[0m
     ←[31mCapybara::InfiniteRedirectError:←[0m
       ←[31mredirected more than 5 times, check for infinite redirects.←[0m
←[36m     # ./spec/features/customerx/customerx_test_paths_spec.rb:130:in `block (3 levels) in <top (required)>'←[0m

编辑客户通行证的集成测试。但是测试中的每个click_link都会给我们带来错误。代码有什么问题?感谢。

0 个答案:

没有答案