闭社主体 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.

29 lines
712 B

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. RSpec.describe ActivityPub::InboxesController, type: :controller do
  4. describe 'POST #create' do
  5. context 'with signed_request_account' do
  6. it 'returns 202' do
  7. allow(controller).to receive(:signed_request_account) do
  8. Fabricate(:account)
  9. end
  10. post :create, body: '{}'
  11. expect(response).to have_http_status(202)
  12. end
  13. end
  14. context 'without signed_request_account' do
  15. it 'returns 401' do
  16. allow(controller).to receive(:signed_request_account) do
  17. false
  18. end
  19. post :create, body: '{}'
  20. expect(response).to have_http_status(401)
  21. end
  22. end
  23. end
  24. end