闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
393 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe ApiController, type: :controller do
  4. controller do
  5. def success
  6. head 200
  7. end
  8. end
  9. it 'does not protect from forgery' do
  10. ActionController::Base.allow_forgery_protection = true
  11. routes.draw { post 'success' => 'api#success' }
  12. post 'success'
  13. expect(response).to have_http_status(:success)
  14. end
  15. end