From bb71c5d89f8bfd8a8047bf7056ad4b518c87ac64 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Thu, 21 Nov 2013 16:04:23 +0100 Subject: [PATCH] No limits when testing. --- config/initializers/rack_attack.rb.example | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config/initializers/rack_attack.rb.example b/config/initializers/rack_attack.rb.example index c6d3605..1d2dee9 100644 --- a/config/initializers/rack_attack.rb.example +++ b/config/initializers/rack_attack.rb.example @@ -7,6 +7,9 @@ paths_to_be_protected = [ "#{Rails.application.config.relative_url_root}/users/sign_in", "#{Rails.application.config.relative_url_root}/users" ] -Rack::Attack.throttle('protected paths', limit: 6, period: 60.seconds) do |req| - req.ip if paths_to_be_protected.include?(req.path) && req.post? + +unless Rails.env.test? + Rack::Attack.throttle('protected paths', limit: 6, period: 60.seconds) do |req| + req.ip if paths_to_be_protected.include?(req.path) && req.post? + end end -- libgit2 0.21.2