Make throttling_spec work when running it with rails 4.2

This commit is contained in:
Gonzalo Rodriguez 2018-03-21 17:29:44 -03:00
parent 08b2cc4d95
commit 0ff1b5be83
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1

View file

@ -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