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/activitypub/inboxes_controller_spec.rb

30 lines
682 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe ActivityPub::InboxesController, type: :controller do
describe 'POST #create' do
context 'if signed_request_account' do
it 'returns 202' do
allow(controller).to receive(:signed_request_account) do
Fabricate(:account)
end
post :create
expect(response).to have_http_status(202)
end
end
context 'not signed_request_account' do
it 'returns 401' do
allow(controller).to receive(:signed_request_account) do
false
end
post :create
expect(response).to have_http_status(401)
end
end
end
end