Add ReportNote test
authorAlex Gleason <alex@alexgleason.me>
Sun, 2 Aug 2020 21:37:33 +0000 (16:37 -0500)
committerAlex Gleason <alex@alexgleason.me>
Sun, 2 Aug 2020 22:45:15 +0000 (17:45 -0500)
test/report_note_test.exs [new file with mode: 0644]
test/support/factory.ex

diff --git a/test/report_note_test.exs b/test/report_note_test.exs
new file mode 100644 (file)
index 0000000..25c1d6a
--- /dev/null
@@ -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
index 4c09d65b61ee48b4bea78c0cdcee228e46d52472..486eda8da5676fc0b86dc39ce16a7b093ec32016 100644 (file)
@@ -311,7 +311,7 @@ defmodule Pleroma.Factory do
       "to" => [],
       "cc" => [activity.actor],
       "context" => activity.data["context"],
-      "state" => state,
+      "state" => state
     }
 
     %Pleroma.Activity{