Skip to content

Commit f666956

Browse files
ysksnhiyuki2578
authored andcommitted
Add specs for ActivityPub::InboxesController (mastodon#9456)
1 parent 8df4277 commit f666956

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,29 @@
1+
# frozen_string_literal: true
2+
13
require 'rails_helper'
24

35
RSpec.describe ActivityPub::InboxesController, type: :controller do
46
describe 'POST #create' do
5-
pending
7+
context 'if signed_request_account' do
8+
it 'returns 202' do
9+
allow(controller).to receive(:signed_request_account) do
10+
Fabricate(:account)
11+
end
12+
13+
post :create
14+
expect(response).to have_http_status(202)
15+
end
16+
end
17+
18+
context 'not signed_request_account' do
19+
it 'returns 401' do
20+
allow(controller).to receive(:signed_request_account) do
21+
false
22+
end
23+
24+
post :create
25+
expect(response).to have_http_status(401)
26+
end
27+
end
628
end
729
end

0 commit comments

Comments
 (0)