From 0ff1b5be83189f5af5f526cbfb37f2c8ef3c7302 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Wed, 21 Mar 2018 17:29:44 -0300 Subject: [PATCH] Make throttling_spec work when running it with rails 4.2 --- spec/acceptance/throttling_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/acceptance/throttling_spec.rb b/spec/acceptance/throttling_spec.rb index 233016c..396589a 100644 --- a/spec/acceptance/throttling_spec.rb +++ b/spec/acceptance/throttling_spec.rb @@ -36,7 +36,7 @@ describe "#throttle" do # Could be used to have different rate limits for authorized # vs general requests limit_proc = lambda do |request| - if request.get_header("X-APIKey") == "private-secret" + if request.env["X-APIKey"] == "private-secret" 2 else 1 @@ -67,7 +67,7 @@ describe "#throttle" do # Could be used to have different rate limits for authorized # vs general requests period_proc = lambda do |request| - if request.get_header("X-APIKey") == "private-secret" + if request.env["X-APIKey"] == "private-secret" 10 else 30