fix tests

This commit is contained in:
2022-01-22 17:21:13 -05:00
parent 16018ae111
commit 820ceed6bb
11 changed files with 142 additions and 1103 deletions

View File

@ -5,9 +5,30 @@ defmodule CanneryWeb.AmmoTypeLiveTest do
alias Cannery.Ammo
@create_attrs %{bullet_type: "some bullet_type", case_material: "some case_material", desc: "some desc", manufacturer: "some manufacturer", name: "some name", weight: 120.5}
@update_attrs %{bullet_type: "some updated bullet_type", case_material: "some updated case_material", desc: "some updated desc", manufacturer: "some updated manufacturer", name: "some updated name", weight: 456.7}
@invalid_attrs %{bullet_type: nil, case_material: nil, desc: nil, manufacturer: nil, name: nil, weight: nil}
@create_attrs %{
"bullet_type" => "some bullet_type",
"case_material" => "some case_material",
"desc" => "some desc",
"manufacturer" => "some manufacturer",
"name" => "some name",
"weight" => 120.5
}
@update_attrs %{
"bullet_type" => "some updated bullet_type",
"case_material" => "some updated case_material",
"desc" => "some updated desc",
"manufacturer" => "some updated manufacturer",
"name" => "some updated name",
"weight" => 456.7
}
@invalid_attrs %{
"bullet_type" => nil,
"case_material" => nil,
"desc" => nil,
"manufacturer" => nil,
"name" => nil,
"weight" => nil
}
defp fixture(:ammo_type) do
{:ok, ammo_type} = Ammo.create_ammo_type(@create_attrs)

View File

@ -5,8 +5,18 @@ defmodule CanneryWeb.ContainerLiveTest do
alias Cannery.Containers
@create_attrs %{desc: "some desc", location: "some location", name: "some name", type: "some type"}
@update_attrs %{desc: "some updated desc", location: "some updated location", name: "some updated name", type: "some updated type"}
@create_attrs %{
"desc" => "some desc",
"location" => "some location",
"name" => "some name",
"type" => "some type"
}
@update_attrs %{
"desc" => "some updated desc",
"location" => "some updated location",
"name" => "some updated name",
"type" => "some updated type"
}
@invalid_attrs %{desc: nil, location: nil, name: nil, type: nil}
defp fixture(:container) do

View File

@ -5,9 +5,21 @@ defmodule CanneryWeb.TagLiveTest do
alias Cannery.Tags
@create_attrs %{bg_color: "some bg-color", name: "some name", text_color: "some text-color"}
@update_attrs %{bg_color: "some updated bg-color", name: "some updated name", text_color: "some updated text-color"}
@invalid_attrs %{bg_color: nil, name: nil, text_color: nil}
@create_attrs %{
"bg_color" => "some bg-color",
"name" => "some name",
"text_color" => "some text-color"
}
@update_attrs %{
"bg_color" => "some updated bg-color",
"name" => "some updated name",
"text_color" => "some updated text-color"
}
@invalid_attrs %{
"bg_color" => nil,
"name" => nil,
"text_color" => nil
}
defp fixture(:tag) do
{:ok, tag} = Tags.create_tag(@create_attrs)
@ -26,7 +38,7 @@ defmodule CanneryWeb.TagLiveTest do
{:ok, _index_live, html} = live(conn, Routes.tag_index_path(conn, :index))
assert html =~ "Listing Tags"
assert html =~ tag.bg-color
assert html =~ tag.bg_color
end
test "saves new tag", %{conn: conn} do
@ -88,7 +100,7 @@ defmodule CanneryWeb.TagLiveTest do
{:ok, _show_live, html} = live(conn, Routes.tag_show_path(conn, :show, tag))
assert html =~ "Show Tag"
assert html =~ tag.bg-color
assert html =~ tag.bg_color
end
test "updates tag within modal", %{conn: conn, tag: tag} do