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)
endThe error message (for Google to pick this up).
Capybara::InfiniteRedirectError:
   redirected more than 5 times, check for infinite redirects.Source: Capybara/Rails.
Written by Thomas Klemm
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
 #Rails 
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#

 
 
 
 
