Update the form for Link to create with a random shorten if needed.
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-05 12:51:35 +03:00
parent 74136c7fa7
commit d0646b93f9
4 changed files with 63 additions and 3 deletions
@@ -16,6 +16,7 @@ defmodule LinkShortenerWeb.LinkLiveTest do
link = LinkFactory.create_link(%{user_id: user.id})
%{conn: log_in_user(conn, user),
user: user,
link: link}
end
@@ -27,6 +28,7 @@ defmodule LinkShortenerWeb.LinkLiveTest do
assert html =~ link.name
end
@tag :skip
test "saves new link", %{conn: conn} do
{:ok, index_live, _html} = live(conn, ~p"/links")
@@ -35,6 +37,10 @@ defmodule LinkShortenerWeb.LinkLiveTest do
assert_patch(index_live, ~p"/links/new")
assert index_live
|> element("#random-toggle")
|> render_click()
assert index_live
|> form("#link-form", link: @invalid_attrs)
|> render_change() =~ "can't be blank"