Various refactoring and typespec improvements
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -19,28 +19,32 @@ defmodule Mobilizon.Service.Admin.ActionLogTest do
|
||||
|
||||
describe "action_log_creation" do
|
||||
test "log a report update", %{moderator: moderator} do
|
||||
%Report{id: _report_id} = report = insert(:report)
|
||||
%Report{id: report_id} = report = insert(:report)
|
||||
|
||||
assert {:ok,
|
||||
%ActionLog{
|
||||
target_type: "Elixir.Mobilizon.Reports.Report",
|
||||
target_id: report_id,
|
||||
target_id: found_report_id,
|
||||
action: :update,
|
||||
actor: moderator
|
||||
actor: _moderator
|
||||
}} = Admin.log_action(moderator, "update", report)
|
||||
|
||||
assert found_report_id == report_id
|
||||
end
|
||||
|
||||
test "log the creation of a report note", %{moderator: moderator} do
|
||||
%Report{} = report = insert(:report)
|
||||
%Note{id: _note_id} = report = insert(:report_note, report: report)
|
||||
%Note{id: note_id} = report = insert(:report_note, report: report)
|
||||
|
||||
assert {:ok,
|
||||
%ActionLog{
|
||||
target_type: "Elixir.Mobilizon.Reports.Note",
|
||||
target_id: note_id,
|
||||
target_id: found_note_id,
|
||||
action: :create,
|
||||
actor: moderator
|
||||
actor: _moderator
|
||||
}} = Admin.log_action(moderator, "create", report)
|
||||
|
||||
assert found_note_id == note_id
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user