Compare commits

..

1 Commits

Author SHA1 Message Date
571f6fffdb improve tagging logic
Some checks are pending
continuous-integration/drone/push Build is running
2022-12-19 22:34:00 -05:00
3 changed files with 24 additions and 12 deletions

View File

@ -18,7 +18,7 @@ defmodule MemexWeb.ContextLiveTest do
} }
@invalid_attrs %{ @invalid_attrs %{
"content" => nil, "content" => nil,
"tags_string" => "", "tags_string" => " ",
"slug" => nil, "slug" => nil,
"visibility" => nil "visibility" => nil
} }
@ -114,9 +114,13 @@ defmodule MemexWeb.ContextLiveTest do
assert_patch(show_live, Routes.context_show_path(conn, :edit, context.slug)) assert_patch(show_live, Routes.context_show_path(conn, :edit, context.slug))
assert show_live html =
|> form("#context-form", context: @invalid_attrs) show_live
|> render_change() =~ "can't be blank" |> form("#context-form", context: @invalid_attrs)
|> render_change()
assert html =~ "can't be blank"
assert html =~ "tags must be comma-delimited"
{:ok, _, html} = {:ok, _, html} =
show_live show_live

View File

@ -19,7 +19,7 @@ defmodule MemexWeb.NoteLiveTest do
} }
@invalid_attrs %{ @invalid_attrs %{
"content" => nil, "content" => nil,
"tags_string" => "", "tags_string" => " ",
"slug" => nil, "slug" => nil,
"visibility" => nil "visibility" => nil
} }
@ -54,9 +54,13 @@ defmodule MemexWeb.NoteLiveTest do
assert_patch(index_live, Routes.note_index_path(conn, :new)) assert_patch(index_live, Routes.note_index_path(conn, :new))
assert index_live html =
|> form("#note-form", note: @invalid_attrs) index_live
|> render_change() =~ "can't be blank" |> form("#note-form", note: @invalid_attrs)
|> render_change()
assert html =~ "can't be blank"
assert html =~ "tags must be comma-delimited"
{:ok, _, html} = {:ok, _, html} =
index_live index_live

View File

@ -17,7 +17,7 @@ defmodule MemexWeb.PipelineLiveTest do
} }
@invalid_attrs %{ @invalid_attrs %{
"description" => nil, "description" => nil,
"tags_string" => "", "tags_string" => " ",
"slug" => nil, "slug" => nil,
"visibility" => nil "visibility" => nil
} }
@ -128,9 +128,13 @@ defmodule MemexWeb.PipelineLiveTest do
assert_patch(show_live, Routes.pipeline_show_path(conn, :edit, pipeline.slug)) assert_patch(show_live, Routes.pipeline_show_path(conn, :edit, pipeline.slug))
assert show_live html =
|> form("#pipeline-form", pipeline: @invalid_attrs) show_live
|> render_change() =~ "can't be blank" |> form("#pipeline-form", pipeline: @invalid_attrs)
|> render_change()
assert html =~ "can't be blank"
assert html =~ "tags must be comma-delimited"
{:ok, _, html} = {:ok, _, html} =
show_live show_live