add length limits to all items
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -28,14 +28,14 @@ defmodule Cannery.ContainersTest do
|
||||
"type" => nil
|
||||
}
|
||||
@valid_tag_attrs %{
|
||||
"bg_color" => "some bg-color",
|
||||
"bg_color" => "#100000",
|
||||
"name" => "some name",
|
||||
"text_color" => "some text-color"
|
||||
"text_color" => "#000000"
|
||||
}
|
||||
@update_tag_attrs %{
|
||||
"bg_color" => "some updated bg-color",
|
||||
"bg_color" => "#100001",
|
||||
"name" => "some updated name",
|
||||
"text_color" => "some updated text-color"
|
||||
"text_color" => "#000001"
|
||||
}
|
||||
@invalid_tag_attrs %{
|
||||
"bg_color" => nil,
|
||||
@ -186,9 +186,9 @@ defmodule Cannery.ContainersTest do
|
||||
|
||||
test "create_tag/2 with valid data creates a tag", %{current_user: current_user} do
|
||||
assert {:ok, %Tag{} = tag} = Containers.create_tag(@valid_tag_attrs, current_user)
|
||||
assert tag.bg_color == "some bg-color"
|
||||
assert tag.bg_color == "#100000"
|
||||
assert tag.name == "some name"
|
||||
assert tag.text_color == "some text-color"
|
||||
assert tag.text_color == "#000000"
|
||||
end
|
||||
|
||||
test "create_tag/2 with invalid data returns error changeset",
|
||||
@ -198,9 +198,9 @@ defmodule Cannery.ContainersTest do
|
||||
|
||||
test "update_tag/3 with valid data updates the tag", %{tag: tag, current_user: current_user} do
|
||||
assert {:ok, %Tag{} = tag} = Containers.update_tag(tag, @update_tag_attrs, current_user)
|
||||
assert tag.bg_color == "some updated bg-color"
|
||||
assert tag.bg_color == "#100001"
|
||||
assert tag.name == "some updated name"
|
||||
assert tag.text_color == "some updated text-color"
|
||||
assert tag.text_color == "#000001"
|
||||
end
|
||||
|
||||
test "update_tag/3 with invalid data returns error changeset",
|
||||
|
@ -10,14 +10,14 @@ defmodule CanneryWeb.TagLiveTest do
|
||||
@moduletag :tag_live_test
|
||||
|
||||
@create_attrs %{
|
||||
"bg_color" => "some bg-color",
|
||||
"bg_color" => "#100000",
|
||||
"name" => "some name",
|
||||
"text_color" => "some text-color"
|
||||
"text_color" => "#000000"
|
||||
}
|
||||
@update_attrs %{
|
||||
"bg_color" => "some updated bg-color",
|
||||
"bg_color" => "#100001",
|
||||
"name" => "some updated name",
|
||||
"text_color" => "some updated text-color"
|
||||
"text_color" => "#000001"
|
||||
}
|
||||
|
||||
# @invalid_attrs %{
|
||||
@ -86,7 +86,7 @@ defmodule CanneryWeb.TagLiveTest do
|
||||
|> follow_redirect(conn, Routes.tag_index_path(conn, :index))
|
||||
|
||||
assert html =~ dgettext("actions", "%{name} created successfully", name: "some name")
|
||||
assert html =~ "some bg-color"
|
||||
assert html =~ "#100000"
|
||||
end
|
||||
|
||||
test "updates tag in listing", %{conn: conn, tag: tag} do
|
||||
@ -110,7 +110,7 @@ defmodule CanneryWeb.TagLiveTest do
|
||||
assert html =~
|
||||
dgettext("prompts", "%{name} updated successfully", name: "some updated name")
|
||||
|
||||
assert html =~ "some updated bg-color"
|
||||
assert html =~ "#100001"
|
||||
end
|
||||
|
||||
test "deletes tag in listing", %{conn: conn, tag: tag} do
|
||||
|
@ -149,9 +149,9 @@ defmodule Cannery.Fixtures do
|
||||
def tag_fixture(attrs \\ %{}, %User{} = user) do
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
"bg_color" => "some bg-color",
|
||||
"bg_color" => "#100000",
|
||||
"name" => "some name",
|
||||
"text_color" => "some text-color"
|
||||
"text_color" => "#000000"
|
||||
})
|
||||
|> Containers.create_tag(user)
|
||||
|> unwrap_ok_tuple()
|
||||
|
Reference in New Issue
Block a user