From ee1cca8fe47a571f61eaf078902663d922df51ce Mon Sep 17 00:00:00 2001 From: Luna D Date: Mon, 8 Nov 2021 11:23:06 +0100 Subject: [PATCH] remove tests for now --- test/philomena/moderation_logs_test.exs | 27 ++++++++++--------- .../moderation_log_controller_test.exs | 16 ----------- .../fixtures/moderation_logs_fixtures.ex | 18 ------------- 3 files changed, 14 insertions(+), 47 deletions(-) delete mode 100644 test/philomena_web/controllers/moderation_log_controller_test.exs delete mode 100644 test/support/fixtures/moderation_logs_fixtures.ex diff --git a/test/philomena/moderation_logs_test.exs b/test/philomena/moderation_logs_test.exs index bfc60151..f8ae2966 100644 --- a/test/philomena/moderation_logs_test.exs +++ b/test/philomena/moderation_logs_test.exs @@ -6,24 +6,25 @@ defmodule Philomena.ModerationLogsTest do describe "moderation_logs" do alias Philomena.ModerationLogs.ModerationLog - import Philomena.ModerationLogsFixtures + import Philomena.UsersFixtures - @invalid_attrs %{} + test "create_moderation_log/4 with valid data creates a moderation_log" do + user = user_fixture() - test "list_moderation_logs/0 returns all moderation_logs" do - moderation_log = moderation_log_fixture() - assert ModerationLogs.list_moderation_logs() == [moderation_log] + assert {:ok, %ModerationLog{} = _moderation_log} = + ModerationLogs.create_moderation_log( + user, + "User:update", + "/path/to/subject", + "Updated user" + ) end - test "create_moderation_log/1 with valid data creates a moderation_log" do - valid_attrs = %{} + test "create_moderation_log/4 with invalid data returns error changeset" do + user = user_fixture() - assert {:ok, %ModerationLog{} = moderation_log} = - ModerationLogs.create_moderation_log(valid_attrs) - end - - test "create_moderation_log/1 with invalid data returns error changeset" do - assert {:error, %Ecto.Changeset{}} = ModerationLogs.create_moderation_log(@invalid_attrs) + assert {:error, %Ecto.Changeset{}} = + ModerationLogs.create_moderation_log(user, nil, nil, nil) end end end diff --git a/test/philomena_web/controllers/moderation_log_controller_test.exs b/test/philomena_web/controllers/moderation_log_controller_test.exs deleted file mode 100644 index b71569c8..00000000 --- a/test/philomena_web/controllers/moderation_log_controller_test.exs +++ /dev/null @@ -1,16 +0,0 @@ -defmodule PhilomenaWeb.ModerationLogControllerTest do - use PhilomenaWeb.ConnCase - - import Philomena.ModerationLogsFixtures - - @create_attrs %{} - @update_attrs %{} - @invalid_attrs %{} - - describe "index" do - test "lists all moderation_logs", %{conn: conn} do - conn = get(conn, Routes.moderation_log_path(conn, :index)) - assert html_response(conn, 200) =~ "Listing Moderation logs" - end - end -end diff --git a/test/support/fixtures/moderation_logs_fixtures.ex b/test/support/fixtures/moderation_logs_fixtures.ex deleted file mode 100644 index e39117ae..00000000 --- a/test/support/fixtures/moderation_logs_fixtures.ex +++ /dev/null @@ -1,18 +0,0 @@ -defmodule Philomena.ModerationLogsFixtures do - @moduledoc """ - This module defines test helpers for creating - entities via the `Philomena.ModerationLogs` context. - """ - - @doc """ - Generate a moderation_log. - """ - def moderation_log_fixture(attrs \\ %{}) do - {:ok, moderation_log} = - attrs - |> Enum.into(%{}) - |> Philomena.ModerationLogs.create_moderation_log() - - moderation_log - end -end