mirror of
https://github.com/lunaisnotaboy/mastodon.git
synced 2024-11-17 20:32:56 +00:00
f0634ba876
* 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
22 lines
412 B
Ruby
22 lines
412 B
Ruby
# frozen_string_literal: true
|
|
|
|
require 'rails_helper'
|
|
|
|
describe ApiController, type: :controller do
|
|
controller do
|
|
def success
|
|
head 200
|
|
end
|
|
end
|
|
|
|
before do
|
|
routes.draw { post 'success' => 'api#success' }
|
|
end
|
|
|
|
it 'does not protect from forgery' do
|
|
ActionController::Base.allow_forgery_protection = true
|
|
post 'success'
|
|
expect(response).to have_http_status(:success)
|
|
end
|
|
end
|