From ee6266be3fa11b69504e64909e9edd78b58eb2d6 Mon Sep 17 00:00:00 2001 From: shibao Date: Mon, 4 Jul 2022 21:06:35 -0400 Subject: [PATCH] harden tag changesets --- lib/cannery/tags.ex | 18 ++-------- lib/cannery/tags/tag.ex | 7 ++-- .../live/tag_live/form_component.ex | 33 ++++++++++++++++--- priv/gettext/actions.pot | 2 +- priv/gettext/de/LC_MESSAGES/actions.po | 2 +- priv/gettext/de/LC_MESSAGES/default.po | 6 ++-- priv/gettext/de/LC_MESSAGES/prompts.po | 6 ++-- priv/gettext/default.pot | 6 ++-- priv/gettext/en/LC_MESSAGES/actions.po | 2 +- priv/gettext/en/LC_MESSAGES/default.po | 6 ++-- priv/gettext/en/LC_MESSAGES/prompts.po | 6 ++-- priv/gettext/es/LC_MESSAGES/actions.po | 2 +- priv/gettext/es/LC_MESSAGES/default.po | 6 ++-- priv/gettext/es/LC_MESSAGES/prompts.po | 6 ++-- priv/gettext/fr/LC_MESSAGES/actions.po | 2 +- priv/gettext/fr/LC_MESSAGES/default.po | 6 ++-- priv/gettext/fr/LC_MESSAGES/prompts.po | 6 ++-- priv/gettext/prompts.pot | 6 ++-- test/cannery/tags_test.exs | 4 --- 19 files changed, 70 insertions(+), 62 deletions(-) diff --git a/lib/cannery/tags.ex b/lib/cannery/tags.ex index 8b3e960..91069e3 100644 --- a/lib/cannery/tags.ex +++ b/lib/cannery/tags.ex @@ -74,8 +74,8 @@ defmodule Cannery.Tags do """ @spec create_tag(attrs :: map(), User.t()) :: {:ok, Tag.t()} | {:error, Changeset.t(Tag.new_tag())} - def create_tag(attrs, %User{id: user_id}), - do: %Tag{} |> Tag.create_changeset(attrs |> Map.put("user_id", user_id)) |> Repo.insert() + def create_tag(attrs, %User{} = user), + do: %Tag{} |> Tag.create_changeset(user, attrs) |> Repo.insert() @doc """ Updates a tag. @@ -121,20 +121,6 @@ defmodule Cannery.Tags do @spec delete_tag!(Tag.t(), User.t()) :: Tag.t() def delete_tag!(%Tag{user_id: user_id} = tag, %User{id: user_id}), do: tag |> Repo.delete!() - @doc """ - Returns an `%Changeset{}` for tracking tag changes. - - ## Examples - - iex> change_tag(tag) - %Changeset{data: %Tag{}} - - """ - @spec change_tag(Tag.t() | Tag.new_tag()) :: Changeset.t(Tag.t() | Tag.new_tag()) - @spec change_tag(Tag.t() | Tag.new_tag(), attrs :: map()) :: - Changeset.t(Tag.t() | Tag.new_tag()) - def change_tag(tag, attrs \\ %{}), do: Tag.update_changeset(tag, attrs) - @doc """ Get a random tag bg_color in `#ffffff` hex format diff --git a/lib/cannery/tags/tag.ex b/lib/cannery/tags/tag.ex index addeb06..a0dd0d7 100644 --- a/lib/cannery/tags/tag.ex +++ b/lib/cannery/tags/tag.ex @@ -35,10 +35,11 @@ defmodule Cannery.Tags.Tag do @type id() :: UUID.t() @doc false - @spec create_changeset(new_tag(), attrs :: map()) :: Changeset.t(new_tag()) - def create_changeset(tag, attrs) do + @spec create_changeset(new_tag(), User.t(), attrs :: map()) :: Changeset.t(new_tag()) + def create_changeset(tag, %User{id: user_id}, attrs) do tag - |> cast(attrs, [:name, :bg_color, :text_color, :user_id]) + |> change(user_id: user_id) + |> cast(attrs, [:name, :bg_color, :text_color]) |> validate_required([:name, :bg_color, :text_color, :user_id]) end diff --git a/lib/cannery_web/live/tag_live/form_component.ex b/lib/cannery_web/live/tag_live/form_component.ex index 6f51cea..6d1b8b8 100644 --- a/lib/cannery_web/live/tag_live/form_component.ex +++ b/lib/cannery_web/live/tag_live/form_component.ex @@ -12,19 +12,44 @@ defmodule CanneryWeb.TagLive.FormComponent do @impl true @spec update(%{:tag => Tag.t(), :current_user => User.t(), optional(any) => any}, Socket.t()) :: {:ok, Socket.t()} - def update(%{tag: tag} = assigns, socket) do - {:ok, socket |> assign(assigns) |> assign(:changeset, Tags.change_tag(tag))} + def update(%{tag: _tag} = assigns, socket) do + {:ok, socket |> assign(assigns) |> assign_changeset(%{})} end @impl true - def handle_event("validate", %{"tag" => tag_params}, %{assigns: %{tag: tag}} = socket) do - {:noreply, socket |> assign(:changeset, tag |> Tags.change_tag(tag_params))} + def handle_event("validate", %{"tag" => tag_params}, socket) do + {:noreply, socket |> assign_changeset(tag_params)} end def handle_event("save", %{"tag" => tag_params}, %{assigns: %{action: action}} = socket) do save_tag(socket, action, tag_params) end + defp assign_changeset( + %{assigns: %{action: action, current_user: user, tag: tag}} = socket, + tag_params + ) do + changeset_action = + case action do + :new -> :insert + :edit -> :update + end + + changeset = + case action do + :new -> tag |> Tag.create_changeset(user, tag_params) + :edit -> tag |> Tag.update_changeset(tag_params) + end + + changeset = + case changeset |> Changeset.apply_action(changeset_action) do + {:ok, _data} -> changeset + {:error, changeset} -> changeset + end + + socket |> assign(:changeset, changeset) + end + @impl true def render(assigns) do ~H""" diff --git a/priv/gettext/actions.pot b/priv/gettext/actions.pot index 0d50768..b94043a 100644 --- a/priv/gettext/actions.pot +++ b/priv/gettext/actions.pot @@ -126,7 +126,7 @@ msgstr "" #: lib/cannery_web/live/container_live/form_component.html.heex:50 #: lib/cannery_web/live/invite_live/form_component.html.heex:28 #: lib/cannery_web/live/range_live/form_component.html.heex:40 -#: lib/cannery_web/live/tag_live/form_component.ex:66 +#: lib/cannery_web/live/tag_live/form_component.ex:91 msgid "Save" msgstr "" diff --git a/priv/gettext/de/LC_MESSAGES/actions.po b/priv/gettext/de/LC_MESSAGES/actions.po index 78497ea..7a68b80 100644 --- a/priv/gettext/de/LC_MESSAGES/actions.po +++ b/priv/gettext/de/LC_MESSAGES/actions.po @@ -139,7 +139,7 @@ msgstr "Passwort zurücksetzen" #: lib/cannery_web/live/container_live/form_component.html.heex:50 #: lib/cannery_web/live/invite_live/form_component.html.heex:28 #: lib/cannery_web/live/range_live/form_component.html.heex:40 -#: lib/cannery_web/live/tag_live/form_component.ex:66 +#: lib/cannery_web/live/tag_live/form_component.ex:91 msgid "Save" msgstr "Speichern" diff --git a/priv/gettext/de/LC_MESSAGES/default.po b/priv/gettext/de/LC_MESSAGES/default.po index 2fd51e8..a407842 100644 --- a/priv/gettext/de/LC_MESSAGES/default.po +++ b/priv/gettext/de/LC_MESSAGES/default.po @@ -65,7 +65,7 @@ msgid "Average Price paid" msgstr "Durchschnittlicher Kaufpreis" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:54 +#: lib/cannery_web/live/tag_live/form_component.ex:79 msgid "Background color" msgstr "Hintergrundfarbe" @@ -287,7 +287,7 @@ msgstr "Meine coole Munitionskiste" #: lib/cannery_web/live/ammo_type_live/index.ex:51 #: lib/cannery_web/live/container_live/form_component.html.heex:20 #: lib/cannery_web/live/invite_live/form_component.html.heex:20 -#: lib/cannery_web/live/tag_live/form_component.ex:50 +#: lib/cannery_web/live/tag_live/form_component.ex:75 msgid "Name" msgstr "Name" @@ -448,7 +448,7 @@ msgid "Tags can be added to your containers to help you organize" msgstr "Tags können zur besseren Ordnung einem Behälter hinzugefügt werden" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:60 +#: lib/cannery_web/live/tag_live/form_component.ex:85 msgid "Text color" msgstr "Textfarbe" diff --git a/priv/gettext/de/LC_MESSAGES/prompts.po b/priv/gettext/de/LC_MESSAGES/prompts.po index 19391a9..cb36e74 100644 --- a/priv/gettext/de/LC_MESSAGES/prompts.po +++ b/priv/gettext/de/LC_MESSAGES/prompts.po @@ -27,7 +27,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/form_component.ex:85 #: lib/cannery_web/live/container_live/form_component.ex:85 #: lib/cannery_web/live/invite_live/form_component.ex:59 -#: lib/cannery_web/live/tag_live/form_component.ex:101 +#: lib/cannery_web/live/tag_live/form_component.ex:126 msgid "%{name} created successfully" msgstr "%{name} erfolgreich erstellt" @@ -65,7 +65,7 @@ msgstr "%{name} erfolgreich aktualisiert" #: lib/cannery_web/live/ammo_type_live/form_component.ex:67 #: lib/cannery_web/live/container_live/form_component.ex:67 #: lib/cannery_web/live/invite_live/form_component.ex:41 -#: lib/cannery_web/live/tag_live/form_component.ex:83 +#: lib/cannery_web/live/tag_live/form_component.ex:108 msgid "%{name} updated successfully" msgstr "%{name} erfolgreich aktualisiert" @@ -173,7 +173,7 @@ msgstr "Registrieren Sie sich, um %{name} zu bearbeiten" #: lib/cannery_web/live/container_live/form_component.html.heex:52 #: lib/cannery_web/live/invite_live/form_component.html.heex:30 #: lib/cannery_web/live/range_live/form_component.html.heex:42 -#: lib/cannery_web/live/tag_live/form_component.ex:68 +#: lib/cannery_web/live/tag_live/form_component.ex:93 msgid "Saving..." msgstr "Speichere..." diff --git a/priv/gettext/default.pot b/priv/gettext/default.pot index ef6ed66..44f92c1 100644 --- a/priv/gettext/default.pot +++ b/priv/gettext/default.pot @@ -50,7 +50,7 @@ msgid "Average Price paid" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:54 +#: lib/cannery_web/live/tag_live/form_component.ex:79 msgid "Background color" msgstr "" @@ -272,7 +272,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/index.ex:51 #: lib/cannery_web/live/container_live/form_component.html.heex:20 #: lib/cannery_web/live/invite_live/form_component.html.heex:20 -#: lib/cannery_web/live/tag_live/form_component.ex:50 +#: lib/cannery_web/live/tag_live/form_component.ex:75 msgid "Name" msgstr "" @@ -431,7 +431,7 @@ msgid "Tags can be added to your containers to help you organize" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:60 +#: lib/cannery_web/live/tag_live/form_component.ex:85 msgid "Text color" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/actions.po b/priv/gettext/en/LC_MESSAGES/actions.po index 7802852..d2919fe 100644 --- a/priv/gettext/en/LC_MESSAGES/actions.po +++ b/priv/gettext/en/LC_MESSAGES/actions.po @@ -127,7 +127,7 @@ msgstr "" #: lib/cannery_web/live/container_live/form_component.html.heex:50 #: lib/cannery_web/live/invite_live/form_component.html.heex:28 #: lib/cannery_web/live/range_live/form_component.html.heex:40 -#: lib/cannery_web/live/tag_live/form_component.ex:66 +#: lib/cannery_web/live/tag_live/form_component.ex:91 msgid "Save" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/default.po b/priv/gettext/en/LC_MESSAGES/default.po index a53724c..ea91d1a 100644 --- a/priv/gettext/en/LC_MESSAGES/default.po +++ b/priv/gettext/en/LC_MESSAGES/default.po @@ -51,7 +51,7 @@ msgid "Average Price paid" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:54 +#: lib/cannery_web/live/tag_live/form_component.ex:79 msgid "Background color" msgstr "" @@ -273,7 +273,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/index.ex:51 #: lib/cannery_web/live/container_live/form_component.html.heex:20 #: lib/cannery_web/live/invite_live/form_component.html.heex:20 -#: lib/cannery_web/live/tag_live/form_component.ex:50 +#: lib/cannery_web/live/tag_live/form_component.ex:75 msgid "Name" msgstr "" @@ -432,7 +432,7 @@ msgid "Tags can be added to your containers to help you organize" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:60 +#: lib/cannery_web/live/tag_live/form_component.ex:85 msgid "Text color" msgstr "" diff --git a/priv/gettext/en/LC_MESSAGES/prompts.po b/priv/gettext/en/LC_MESSAGES/prompts.po index d756e04..7138934 100644 --- a/priv/gettext/en/LC_MESSAGES/prompts.po +++ b/priv/gettext/en/LC_MESSAGES/prompts.po @@ -15,7 +15,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/form_component.ex:85 #: lib/cannery_web/live/container_live/form_component.ex:85 #: lib/cannery_web/live/invite_live/form_component.ex:59 -#: lib/cannery_web/live/tag_live/form_component.ex:101 +#: lib/cannery_web/live/tag_live/form_component.ex:126 msgid "%{name} created successfully" msgstr "" @@ -53,7 +53,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/form_component.ex:67 #: lib/cannery_web/live/container_live/form_component.ex:67 #: lib/cannery_web/live/invite_live/form_component.ex:41 -#: lib/cannery_web/live/tag_live/form_component.ex:83 +#: lib/cannery_web/live/tag_live/form_component.ex:108 msgid "%{name} updated successfully" msgstr "" @@ -155,7 +155,7 @@ msgstr "" #: lib/cannery_web/live/container_live/form_component.html.heex:52 #: lib/cannery_web/live/invite_live/form_component.html.heex:30 #: lib/cannery_web/live/range_live/form_component.html.heex:42 -#: lib/cannery_web/live/tag_live/form_component.ex:68 +#: lib/cannery_web/live/tag_live/form_component.ex:93 msgid "Saving..." msgstr "" diff --git a/priv/gettext/es/LC_MESSAGES/actions.po b/priv/gettext/es/LC_MESSAGES/actions.po index 70292ea..4b6ce50 100644 --- a/priv/gettext/es/LC_MESSAGES/actions.po +++ b/priv/gettext/es/LC_MESSAGES/actions.po @@ -137,7 +137,7 @@ msgstr "" #: lib/cannery_web/live/container_live/form_component.html.heex:50 #: lib/cannery_web/live/invite_live/form_component.html.heex:28 #: lib/cannery_web/live/range_live/form_component.html.heex:40 -#: lib/cannery_web/live/tag_live/form_component.ex:66 +#: lib/cannery_web/live/tag_live/form_component.ex:91 msgid "Save" msgstr "" diff --git a/priv/gettext/es/LC_MESSAGES/default.po b/priv/gettext/es/LC_MESSAGES/default.po index 1bd0ca9..f67c70f 100644 --- a/priv/gettext/es/LC_MESSAGES/default.po +++ b/priv/gettext/es/LC_MESSAGES/default.po @@ -61,7 +61,7 @@ msgid "Average Price paid" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:54 +#: lib/cannery_web/live/tag_live/form_component.ex:79 msgid "Background color" msgstr "" @@ -283,7 +283,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/index.ex:51 #: lib/cannery_web/live/container_live/form_component.html.heex:20 #: lib/cannery_web/live/invite_live/form_component.html.heex:20 -#: lib/cannery_web/live/tag_live/form_component.ex:50 +#: lib/cannery_web/live/tag_live/form_component.ex:75 msgid "Name" msgstr "" @@ -442,7 +442,7 @@ msgid "Tags can be added to your containers to help you organize" msgstr "" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:60 +#: lib/cannery_web/live/tag_live/form_component.ex:85 msgid "Text color" msgstr "" diff --git a/priv/gettext/es/LC_MESSAGES/prompts.po b/priv/gettext/es/LC_MESSAGES/prompts.po index 47ea496..08b04c6 100644 --- a/priv/gettext/es/LC_MESSAGES/prompts.po +++ b/priv/gettext/es/LC_MESSAGES/prompts.po @@ -25,7 +25,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/form_component.ex:85 #: lib/cannery_web/live/container_live/form_component.ex:85 #: lib/cannery_web/live/invite_live/form_component.ex:59 -#: lib/cannery_web/live/tag_live/form_component.ex:101 +#: lib/cannery_web/live/tag_live/form_component.ex:126 msgid "%{name} created successfully" msgstr "" @@ -63,7 +63,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/form_component.ex:67 #: lib/cannery_web/live/container_live/form_component.ex:67 #: lib/cannery_web/live/invite_live/form_component.ex:41 -#: lib/cannery_web/live/tag_live/form_component.ex:83 +#: lib/cannery_web/live/tag_live/form_component.ex:108 msgid "%{name} updated successfully" msgstr "" @@ -165,7 +165,7 @@ msgstr "" #: lib/cannery_web/live/container_live/form_component.html.heex:52 #: lib/cannery_web/live/invite_live/form_component.html.heex:30 #: lib/cannery_web/live/range_live/form_component.html.heex:42 -#: lib/cannery_web/live/tag_live/form_component.ex:68 +#: lib/cannery_web/live/tag_live/form_component.ex:93 msgid "Saving..." msgstr "" diff --git a/priv/gettext/fr/LC_MESSAGES/actions.po b/priv/gettext/fr/LC_MESSAGES/actions.po index 9a686ef..4bb3a89 100644 --- a/priv/gettext/fr/LC_MESSAGES/actions.po +++ b/priv/gettext/fr/LC_MESSAGES/actions.po @@ -139,7 +139,7 @@ msgstr "Réinitialisé le mot de passe" #: lib/cannery_web/live/container_live/form_component.html.heex:50 #: lib/cannery_web/live/invite_live/form_component.html.heex:28 #: lib/cannery_web/live/range_live/form_component.html.heex:40 -#: lib/cannery_web/live/tag_live/form_component.ex:66 +#: lib/cannery_web/live/tag_live/form_component.ex:91 msgid "Save" msgstr "Sauvegarder" diff --git a/priv/gettext/fr/LC_MESSAGES/default.po b/priv/gettext/fr/LC_MESSAGES/default.po index f8dad2a..c509422 100644 --- a/priv/gettext/fr/LC_MESSAGES/default.po +++ b/priv/gettext/fr/LC_MESSAGES/default.po @@ -65,7 +65,7 @@ msgid "Average Price paid" msgstr "Prix acheté moyen" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:54 +#: lib/cannery_web/live/tag_live/form_component.ex:79 msgid "Background color" msgstr "Couleur de fond" @@ -287,7 +287,7 @@ msgstr "Ma superbe boite de munition" #: lib/cannery_web/live/ammo_type_live/index.ex:51 #: lib/cannery_web/live/container_live/form_component.html.heex:20 #: lib/cannery_web/live/invite_live/form_component.html.heex:20 -#: lib/cannery_web/live/tag_live/form_component.ex:50 +#: lib/cannery_web/live/tag_live/form_component.ex:75 msgid "Name" msgstr "Nom" @@ -450,7 +450,7 @@ msgstr "" "organiser" #, elixir-autogen, elixir-format -#: lib/cannery_web/live/tag_live/form_component.ex:60 +#: lib/cannery_web/live/tag_live/form_component.ex:85 msgid "Text color" msgstr "Couleur du texte" diff --git a/priv/gettext/fr/LC_MESSAGES/prompts.po b/priv/gettext/fr/LC_MESSAGES/prompts.po index 01dfa24..a6b1d7a 100644 --- a/priv/gettext/fr/LC_MESSAGES/prompts.po +++ b/priv/gettext/fr/LC_MESSAGES/prompts.po @@ -27,7 +27,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/form_component.ex:85 #: lib/cannery_web/live/container_live/form_component.ex:85 #: lib/cannery_web/live/invite_live/form_component.ex:59 -#: lib/cannery_web/live/tag_live/form_component.ex:101 +#: lib/cannery_web/live/tag_live/form_component.ex:126 msgid "%{name} created successfully" msgstr "%{name} créé· avec succès" @@ -65,7 +65,7 @@ msgstr "%{name} mis à jour avec succès" #: lib/cannery_web/live/ammo_type_live/form_component.ex:67 #: lib/cannery_web/live/container_live/form_component.ex:67 #: lib/cannery_web/live/invite_live/form_component.ex:41 -#: lib/cannery_web/live/tag_live/form_component.ex:83 +#: lib/cannery_web/live/tag_live/form_component.ex:108 msgid "%{name} updated successfully" msgstr "%{name} mis à jour avec succès" @@ -174,7 +174,7 @@ msgstr "S’enregistrer pour mettre en place %{name}" #: lib/cannery_web/live/container_live/form_component.html.heex:52 #: lib/cannery_web/live/invite_live/form_component.html.heex:30 #: lib/cannery_web/live/range_live/form_component.html.heex:42 -#: lib/cannery_web/live/tag_live/form_component.ex:68 +#: lib/cannery_web/live/tag_live/form_component.ex:93 msgid "Saving..." msgstr "Sauvegarde en cours…" diff --git a/priv/gettext/prompts.pot b/priv/gettext/prompts.pot index 116f9d9..fe6e9e9 100644 --- a/priv/gettext/prompts.pot +++ b/priv/gettext/prompts.pot @@ -14,7 +14,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/form_component.ex:85 #: lib/cannery_web/live/container_live/form_component.ex:85 #: lib/cannery_web/live/invite_live/form_component.ex:59 -#: lib/cannery_web/live/tag_live/form_component.ex:101 +#: lib/cannery_web/live/tag_live/form_component.ex:126 msgid "%{name} created successfully" msgstr "" @@ -52,7 +52,7 @@ msgstr "" #: lib/cannery_web/live/ammo_type_live/form_component.ex:67 #: lib/cannery_web/live/container_live/form_component.ex:67 #: lib/cannery_web/live/invite_live/form_component.ex:41 -#: lib/cannery_web/live/tag_live/form_component.ex:83 +#: lib/cannery_web/live/tag_live/form_component.ex:108 msgid "%{name} updated successfully" msgstr "" @@ -154,7 +154,7 @@ msgstr "" #: lib/cannery_web/live/container_live/form_component.html.heex:52 #: lib/cannery_web/live/invite_live/form_component.html.heex:30 #: lib/cannery_web/live/range_live/form_component.html.heex:42 -#: lib/cannery_web/live/tag_live/form_component.ex:68 +#: lib/cannery_web/live/tag_live/form_component.ex:93 msgid "Saving..." msgstr "" diff --git a/test/cannery/tags_test.exs b/test/cannery/tags_test.exs index 73306b3..748f476 100644 --- a/test/cannery/tags_test.exs +++ b/test/cannery/tags_test.exs @@ -68,9 +68,5 @@ defmodule Cannery.TagsTest do assert {:ok, %Tag{}} = Tags.delete_tag(tag, current_user) assert_raise Ecto.NoResultsError, fn -> Tags.get_tag!(tag.id, current_user) end end - - test "change_tag/1 returns a tag changeset", %{tag: tag} do - assert %Changeset{} = Tags.change_tag(tag) - end end end