Add ReportNote test

This commit is contained in:
Alex Gleason 2020-08-02 16:37:33 -05:00
parent 77b48cb4ce
commit f9301044ed
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 17 additions and 1 deletions

16
test/report_note_test.exs Normal file
View file

@ -0,0 +1,16 @@
# Pleroma: A lightweight social networking server
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ReportNoteTest do
alias Pleroma.ReportNote
use Pleroma.DataCase
import Pleroma.Factory
test "create/3" do
user = insert(:user)
report = insert(:report_activity)
assert {:ok, note} = ReportNote.create(user.id, report.id, "naughty boy")
assert note.content == "naughty boy"
end
end

View file

@ -311,7 +311,7 @@ defmodule Pleroma.Factory do
"to" => [], "to" => [],
"cc" => [activity.actor], "cc" => [activity.actor],
"context" => activity.data["context"], "context" => activity.data["context"],
"state" => state, "state" => state
} }
%Pleroma.Activity{ %Pleroma.Activity{