mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
Fix spec expectations
This commit is contained in:
parent
cfbee2c552
commit
f348643c24
3 changed files with 6 additions and 6 deletions
|
|
@ -24,7 +24,7 @@ describe 'Rack::Attack.Fail2Ban' do
|
|||
describe 'when not at maxretry' do
|
||||
before { get '/?foo=OMGHAX', {}, 'REMOTE_ADDR' => '1.2.3.4' }
|
||||
it 'fails' do
|
||||
last_response.status.must_equal 503
|
||||
last_response.status.must_equal 401
|
||||
end
|
||||
|
||||
it 'increases fail count' do
|
||||
|
|
@ -46,7 +46,7 @@ describe 'Rack::Attack.Fail2Ban' do
|
|||
end
|
||||
|
||||
it 'fails' do
|
||||
last_response.status.must_equal 503
|
||||
last_response.status.must_equal 401
|
||||
end
|
||||
|
||||
it 'increases fail count' do
|
||||
|
|
@ -83,7 +83,7 @@ describe 'Rack::Attack.Fail2Ban' do
|
|||
end
|
||||
|
||||
it 'fails' do
|
||||
last_response.status.must_equal 503
|
||||
last_response.status.must_equal 401
|
||||
end
|
||||
|
||||
it 'does not increase fail count' do
|
||||
|
|
@ -103,7 +103,7 @@ describe 'Rack::Attack.Fail2Ban' do
|
|||
end
|
||||
|
||||
it 'fails' do
|
||||
last_response.status.must_equal 503
|
||||
last_response.status.must_equal 401
|
||||
end
|
||||
|
||||
it 'does not increase fail count' do
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ describe 'Rack::Attack' do
|
|||
before { get '/', {}, 'REMOTE_ADDR' => @bad_ip }
|
||||
it "should return a blacklist response" do
|
||||
get '/', {}, 'REMOTE_ADDR' => @bad_ip
|
||||
last_response.status.must_equal 503
|
||||
last_response.status.must_equal 401
|
||||
end
|
||||
it "should tag the env" do
|
||||
last_request.env['rack.attack.matched'].must_equal "ip #{@bad_ip}"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ describe 'Rack::Attack.throttle' do
|
|||
2.times { get '/', {}, 'REMOTE_ADDR' => '1.2.3.4' }
|
||||
end
|
||||
it 'should block the last request' do
|
||||
last_response.status.must_equal 503
|
||||
last_response.status.must_equal 429
|
||||
end
|
||||
it 'should tag the env' do
|
||||
last_request.env['rack.attack.matched'].must_equal 'ip/sec'
|
||||
|
|
|
|||
Loading…
Reference in a new issue