From 04361a583864cd95a046870df0b4af27725241a0 Mon Sep 17 00:00:00 2001 From: shibao Date: Tue, 28 Mar 2023 22:03:00 -0400 Subject: [PATCH] improve invite tests --- test/memex_web/live/invite_live_test.exs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/memex_web/live/invite_live_test.exs b/test/memex_web/live/invite_live_test.exs index 986f3c2..06424d2 100644 --- a/test/memex_web/live/invite_live_test.exs +++ b/test/memex_web/live/invite_live_test.exs @@ -10,7 +10,7 @@ defmodule MemexWeb.InviteLiveTest do @moduletag :invite_live_test @create_attrs %{name: "some name"} @update_attrs %{name: "some updated name"} - # @invalid_attrs %{"name" => nil} + @invalid_attrs %{name: nil} describe "Index" do setup [:register_and_log_in_user] @@ -32,9 +32,9 @@ defmodule MemexWeb.InviteLiveTest do assert index_live |> element("a", "create invite") |> render_click() =~ "new invite" assert_patch(index_live, Routes.invite_index_path(conn, :new)) - # assert index_live - # |> form("#invite-form") - # |> render_change(invite: @invalid_attrs) =~ "can't be blank" + assert index_live + |> form("#invite-form") + |> render_change(invite: @invalid_attrs) =~ "can't be blank" {:ok, _live, html} = index_live @@ -54,9 +54,9 @@ defmodule MemexWeb.InviteLiveTest do assert_patch(index_live, Routes.invite_index_path(conn, :edit, invite)) - # assert index_live - # |> form("#invite-form") - # |> render_change(invite: @invalid_attrs) =~ "can't be blank" + assert index_live + |> form("#invite-form") + |> render_change(invite: @invalid_attrs) =~ "can't be blank" {:ok, _live, html} = index_live