8bz_eq
Last Updated: February 25, 2016
·
1.671K
· thomasklemm
F27f3cb5efa4481b71db7f28dae9ac64

Set a custom redirect limit for Capybara in Rails

If you see a Capybara::InfiniteRedirectError but want to try to raise the default limit of 5 a little higher to see what happens then, this might help.

# spec/spec_helper.rb
Capybara.register_driver :rack_test do |app|
  Capybara::RackTest::Driver.new(app, :respect_data_method => true, :redirect_limit => 20)
end

The error message (for Google to pick this up).

Capybara::InfiniteRedirectError:
   redirected more than 5 times, check for infinite redirects.

Source: Capybara/Rails.

Say Thanks
Respond