Attempt to make it easier to understand that the method is making assertions

This commit is contained in:
Gonzalo Rodriguez 2018-01-25 10:53:47 -03:00
parent 6f545e2665
commit ca739946ce
5 changed files with 9 additions and 9 deletions

View file

@ -14,6 +14,6 @@ describe 'Rack::Attack' do
end
end
allow_ok_requests
it_allows_ok_requests
end
end

View file

@ -1,7 +1,7 @@
require_relative 'spec_helper'
describe 'Rack::Attack' do
allow_ok_requests
it_allows_ok_requests
describe 'normalizing paths' do
before do
@ -45,7 +45,7 @@ describe 'Rack::Attack' do
last_request.env['rack.attack.match_type'].must_equal :blocklist
end
allow_ok_requests
it_allows_ok_requests
end
describe "and safelist" do

View file

@ -9,7 +9,7 @@ describe 'Rack::Attack.throttle' do
it('should have a throttle') { Rack::Attack.throttles.key?('ip/sec') }
allow_ok_requests
it_allows_ok_requests
describe 'a single request' do
before { get '/', {}, 'REMOTE_ADDR' => '1.2.3.4' }
@ -54,7 +54,7 @@ describe 'Rack::Attack.throttle with limit as proc' do
Rack::Attack.throttle('ip/sec', :limit => lambda { |req| 1 }, :period => @period) { |req| req.ip }
end
allow_ok_requests
it_allows_ok_requests
describe 'a single request' do
before { get '/', {}, 'REMOTE_ADDR' => '1.2.3.4' }
@ -78,7 +78,7 @@ describe 'Rack::Attack.throttle with period as proc' do
Rack::Attack.throttle('ip/sec', :limit => lambda { |req| 1 }, :period => lambda { |req| @period }) { |req| req.ip }
end
allow_ok_requests
it_allows_ok_requests
describe 'a single request' do
before { get '/', {}, 'REMOTE_ADDR' => '1.2.3.4' }
@ -102,7 +102,7 @@ describe 'Rack::Attack.throttle with block retuning nil' do
Rack::Attack.throttle('ip/sec', :limit => 1, :period => @period) { |_| nil }
end
allow_ok_requests
it_allows_ok_requests
describe 'a single request' do
before { get '/', {}, 'REMOTE_ADDR' => '1.2.3.4' }

View file

@ -19,7 +19,7 @@ describe 'Rack::Attack.track' do
Rack::Attack.track("everything"){ |req| true }
end
allow_ok_requests
it_allows_ok_requests
it "should tag the env" do
get '/'

View file

@ -28,7 +28,7 @@ class MiniTest::Spec
}.to_app
end
def self.allow_ok_requests
def self.it_allows_ok_requests
it "must allow ok requests" do
get '/', {}, 'REMOTE_ADDR' => '127.0.0.1'
last_response.status.must_equal 200