inboxes_controller_spec.rb 712 B

1234567891011121314151617181920212223242526272829
  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