This repository has been archived on 2024-06-09. You can view files and clone it, but cannot push or open issues/pull-requests.
2018-12-07 16:40:01 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-08-08 21:52:15 +02:00
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe ActivityPub::InboxesController, type: :controller do
|
|
|
|
describe 'POST #create' do
|
2018-12-07 16:40:01 +01:00
|
|
|
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
|
2017-08-08 21:52:15 +02:00
|
|
|
end
|
|
|
|
end
|