Coverage improvement and concern extraction for rate limit headers in API controller (#3625)
* Coverage for rate limit headers * Move rate limit headers methods to concern * Move throttle check to condition on before_action * Move match_data variable into method * Move utc timestamp to separate method * Move header setting into smaller methods * specs cleanup
This commit is contained in:
committed by
Eugen Rochko
parent
1d68fe1a60
commit
f0634ba876
@@ -9,9 +9,12 @@ describe ApiController, type: :controller do
|
||||
end
|
||||
end
|
||||
|
||||
before do
|
||||
routes.draw { post 'success' => 'api#success' }
|
||||
end
|
||||
|
||||
it 'does not protect from forgery' do
|
||||
ActionController::Base.allow_forgery_protection = true
|
||||
routes.draw { post 'success' => 'api#success' }
|
||||
post 'success'
|
||||
expect(response).to have_http_status(:success)
|
||||
end
|
||||
|
Reference in New Issue
Block a user