ALL TESTS ARE GREEN
This commit is contained in:
parent
92e548e96c
commit
ca0c1a2aa3
4 changed files with 8 additions and 9 deletions
|
@ -7,12 +7,14 @@ defmodule ChiyaWeb.ChannelControllerTest do
|
||||||
content: "some content",
|
content: "some content",
|
||||||
name: "some name",
|
name: "some name",
|
||||||
slug: "some slug",
|
slug: "some slug",
|
||||||
|
layout: :default,
|
||||||
visibility: :public
|
visibility: :public
|
||||||
}
|
}
|
||||||
@update_attrs %{
|
@update_attrs %{
|
||||||
content: "some updated content",
|
content: "some updated content",
|
||||||
name: "some updated name",
|
name: "some updated name",
|
||||||
slug: "some updated slug",
|
slug: "some updated slug",
|
||||||
|
layout: :default,
|
||||||
visibility: :private
|
visibility: :private
|
||||||
}
|
}
|
||||||
@invalid_attrs %{content: nil, name: nil, slug: nil, visibility: nil}
|
@invalid_attrs %{content: nil, name: nil, slug: nil, visibility: nil}
|
||||||
|
|
|
@ -26,7 +26,7 @@ defmodule ChiyaWeb.NoteControllerTest do
|
||||||
describe "index" do
|
describe "index" do
|
||||||
test "lists all notes", %{conn: conn} do
|
test "lists all notes", %{conn: conn} do
|
||||||
conn = get(conn, ~p"/admin/notes")
|
conn = get(conn, ~p"/admin/notes")
|
||||||
assert html_response(conn, 200) =~ "Listing Notes"
|
assert html_response(conn, 200) =~ "Notes"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ defmodule ChiyaWeb.NoteControllerTest do
|
||||||
assert redirected_to(conn) == ~p"/admin/notes/#{id}"
|
assert redirected_to(conn) == ~p"/admin/notes/#{id}"
|
||||||
|
|
||||||
conn = get(conn, ~p"/admin/notes/#{id}")
|
conn = get(conn, ~p"/admin/notes/#{id}")
|
||||||
assert html_response(conn, 200) =~ "Note #{id}"
|
assert html_response(conn, 200) =~ @create_attrs.name
|
||||||
end
|
end
|
||||||
|
|
||||||
test "renders errors when data is invalid", %{conn: conn} do
|
test "renders errors when data is invalid", %{conn: conn} do
|
||||||
|
@ -65,7 +65,7 @@ defmodule ChiyaWeb.NoteControllerTest do
|
||||||
assert redirected_to(conn) == ~p"/admin/notes/#{id}"
|
assert redirected_to(conn) == ~p"/admin/notes/#{id}"
|
||||||
|
|
||||||
conn = get(conn, ~p"/admin/notes/#{id}")
|
conn = get(conn, ~p"/admin/notes/#{id}")
|
||||||
assert html_response(conn, 200) =~ "Note #{id}"
|
assert html_response(conn, 200) =~ @create_attrs.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ defmodule ChiyaWeb.NoteControllerTest do
|
||||||
assert redirected_to(conn) == ~p"/admin/notes/#{note}"
|
assert redirected_to(conn) == ~p"/admin/notes/#{note}"
|
||||||
|
|
||||||
conn = get(conn, ~p"/admin/notes/#{note}")
|
conn = get(conn, ~p"/admin/notes/#{note}")
|
||||||
assert html_response(conn, 200) =~ "some updated content"
|
assert html_response(conn, 200) =~ "some updated name"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,7 @@ defmodule ChiyaWeb.UserSessionControllerTest do
|
||||||
# Now do a logged in request and assert on the menu
|
# Now do a logged in request and assert on the menu
|
||||||
conn = get(conn, ~p"/")
|
conn = get(conn, ~p"/")
|
||||||
response = html_response(conn, 200)
|
response = html_response(conn, 200)
|
||||||
assert response =~ user.email
|
assert response =~ ~p"/admin"
|
||||||
assert response =~ ~p"/user"
|
|
||||||
assert response =~ ~p"/user/log_out"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "logs the user in with remember me", %{conn: conn, user: user} do
|
test "logs the user in with remember me", %{conn: conn, user: user} do
|
||||||
|
|
|
@ -17,8 +17,7 @@ defmodule Chiya.ChannelsFixtures do
|
||||||
attrs
|
attrs
|
||||||
|> Enum.into(%{
|
|> Enum.into(%{
|
||||||
content: "some content",
|
content: "some content",
|
||||||
name: "some name",
|
name: "some name #{System.unique_integer([:positive])}",
|
||||||
slug: unique_channel_slug(),
|
|
||||||
visibility: :public,
|
visibility: :public,
|
||||||
layout: :default
|
layout: :default
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue