From d61410c306e2a9ce0ea845051f6ecf8f05fab623 Mon Sep 17 00:00:00 2001 From: ysksn Date: Sat, 8 Dec 2018 00:40:01 +0900 Subject: [PATCH] Add specs for ActivityPub::InboxesController (#9456) --- .../activitypub/inboxes_controller_spec.rb | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/spec/controllers/activitypub/inboxes_controller_spec.rb b/spec/controllers/activitypub/inboxes_controller_spec.rb index 5c12fea7df..4055d93424 100644 --- a/spec/controllers/activitypub/inboxes_controller_spec.rb +++ b/spec/controllers/activitypub/inboxes_controller_spec.rb @@ -1,7 +1,29 @@ +# frozen_string_literal: true + require 'rails_helper' RSpec.describe ActivityPub::InboxesController, type: :controller do describe 'POST #create' do - pending + 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