From 614e2eeb341cbb4cd8a3ecacbc8d7ae20810c209 Mon Sep 17 00:00:00 2001 From: Uku Taht Date: Wed, 29 Jan 2020 11:33:10 +0200 Subject: [PATCH] Remove unused helper function --- test/support/data_case.ex | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/test/support/data_case.ex b/test/support/data_case.ex index 73b06dc4d..411c83ec3 100644 --- a/test/support/data_case.ex +++ b/test/support/data_case.ex @@ -33,20 +33,4 @@ defmodule Plausible.DataCase do :ok end - - @doc """ - A helper that transforms changeset errors into a map of messages. - - assert {:error, changeset} = Accounts.create_user(%{password: "short"}) - assert "password is too short" in errors_on(changeset).password - assert %{password: ["password is too short"]} = errors_on(changeset) - - """ - def errors_on(changeset) do - Ecto.Changeset.traverse_errors(changeset, fn {message, opts} -> - Enum.reduce(opts, message, fn {key, value}, acc -> - String.replace(acc, "%{#{key}}", to_string(value)) - end) - end) - end end