Skip to content

Commit

Permalink
add test for inbox receiving Flag successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Nov 26, 2024
1 parent 073fd82 commit cb4ac27
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/requests/reports_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
let(:report_body) {
<<-EOF
{
"@context":"https://www.w3.org/ns/activitystreams",
"@context":"https://www.w3.org/ns/activitystreams",
"id":"https://mastodon.me.uk/d977f377-214b-4efd-8a47-70a37fb7ea20",
"type":"Flag",
"actor":"https://mastodon.me.uk/actor",
Expand All @@ -15,6 +15,11 @@
EOF
}

it "should accept Flag activities" do
post user.actor.inbox_url, params: report_body, headers: { content_type: "application/activity" }
expect(response.status).to be :created
end

it "should call registered Report handler when a flag is received by Federails" do
expect(Federails::Moderation::Report).to receive(:handle_flag).once.and_call_original
post user.actor.inbox_url, params: report_body, headers: { content_type: "application/activity" }
Expand Down

0 comments on commit cb4ac27

Please sign in to comment.