gearheads
/
mastodon
Archived
2
0
Fork 0
This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
mastodon/spec/controllers/api_controller_spec.rb

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