#192: refactoring of specs
This commit is contained in:
parent
0c926e850c
commit
507a574fd1
|
@ -120,14 +120,14 @@ describe ApiDefender do
|
|||
end
|
||||
end
|
||||
|
||||
context 'for allowed_addresses' do
|
||||
context 'for allowed addresses' do
|
||||
let(:remote_addr) { APP_CONFIG['allowed_addresses'].first }
|
||||
it "should not return the limit usage for allowed address" do
|
||||
it 'should not return the limit usage for allowed address' do
|
||||
get "/api/v1/users/#{@user.id}.json", {}, {'REMOTE_ADDR' => remote_addr }
|
||||
response.headers['X-RateLimit-Limit'].should_not == @rate_limit.to_s
|
||||
end
|
||||
|
||||
it "should not forbidden allowed address" do
|
||||
it 'should not forbidden allowed address' do
|
||||
(@rate_limit+1).times { get "/api/v1/users/#{@user.id}.json", {}, {'REMOTE_ADDR' => remote_addr } }
|
||||
response.status.should == 200
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue