mirror of
https://git.kescher.at/CatCatNya/catstodon.git
synced 2024-11-24 01:08:08 +01:00
29 lines
706 B
Ruby
29 lines
706 B
Ruby
# 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, body: '{}'
|
|
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, body: '{}'
|
|
expect(response).to have_http_status(401)
|
|
end
|
|
end
|
|
end
|
|
end
|