From 65c70ca398dd61979c4639c6c1eab16c20ca8474 Mon Sep 17 00:00:00 2001 From: shibao Date: Thu, 30 Mar 2023 22:23:54 -0400 Subject: [PATCH] fix name collisions --- lib/cannery_web/live/type_live/show.ex | 4 ++-- test/cannery_web/live/pack_live_test.exs | 4 ++-- test/cannery_web/live/type_live_test.exs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/cannery_web/live/type_live/show.ex b/lib/cannery_web/live/type_live/show.ex index d18b7f3f..22edf897 100644 --- a/lib/cannery_web/live/type_live/show.ex +++ b/lib/cannery_web/live/type_live/show.ex @@ -45,9 +45,9 @@ defmodule CanneryWeb.TypeLive.Show do ) do custom_fields? = fields_to_display(type) - |> Enum.any?(fn %{key: field, type: type} -> + |> Enum.any?(fn %{key: field, type: column_type} -> default_value = - case type do + case column_type do :boolean -> false _other_type -> nil end diff --git a/test/cannery_web/live/pack_live_test.exs b/test/cannery_web/live/pack_live_test.exs index f11c8e10..04befefc 100644 --- a/test/cannery_web/live/pack_live_test.exs +++ b/test/cannery_web/live/pack_live_test.exs @@ -414,7 +414,7 @@ defmodule CanneryWeb.PackLiveTest do end end - describe "Show pack with shot recorddd" do + describe "Show pack with shot record" do setup [:register_and_log_in_user, :create_pack, :create_shot_record] test "updates shot_record in listing", @@ -422,7 +422,7 @@ defmodule CanneryWeb.PackLiveTest do {:ok, index_live, _html} = live(conn, Routes.pack_show_path(conn, :edit, pack)) assert index_live - |> element(~s/a[aria-label="Edit shot recordd of #{shot_record.count} shots"]/) + |> element(~s/a[aria-label="Edit shot record of #{shot_record.count} shots"]/) |> render_click() =~ "Edit Shot Record" assert_patch( diff --git a/test/cannery_web/live/type_live_test.exs b/test/cannery_web/live/type_live_test.exs index 1dab5867..de342be2 100644 --- a/test/cannery_web/live/type_live_test.exs +++ b/test/cannery_web/live/type_live_test.exs @@ -38,7 +38,7 @@ defmodule CanneryWeb.TypeLiveTest do count: 20 } @shot_record_attrs %{ - notes: "some shot recorddd", + notes: "some shot record", count: 20 }