From f9301044ed9c80314d1c313035359956cf5dbc1a Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sun, 2 Aug 2020 16:37:33 -0500 Subject: [PATCH] Add ReportNote test --- test/report_note_test.exs | 16 ++++++++++++++++ test/support/factory.ex | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 test/report_note_test.exs diff --git a/test/report_note_test.exs b/test/report_note_test.exs new file mode 100644 index 000000000..25c1d6a61 --- /dev/null +++ b/test/report_note_test.exs @@ -0,0 +1,16 @@ +# Pleroma: A lightweight social networking server +# Copyright © 2017-2020 Pleroma Authors +# 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 diff --git a/test/support/factory.ex b/test/support/factory.ex index 4c09d65b6..486eda8da 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -311,7 +311,7 @@ def report_activity_factory(attrs \\ %{}) do "to" => [], "cc" => [activity.actor], "context" => activity.data["context"], - "state" => state, + "state" => state } %Pleroma.Activity{