ee cummings this shit

This commit is contained in:
2022-11-17 22:30:01 -05:00
parent 821a8e223c
commit f1889aec07
36 changed files with 177 additions and 176 deletions

View File

@ -24,15 +24,15 @@ defmodule MemexWeb.ContextLiveTest do
test "lists all contexts", %{conn: conn, context: context} do
{:ok, _index_live, html} = live(conn, Routes.context_index_path(conn, :index))
assert html =~ "Listing Contexts"
assert html =~ "listing contexts"
assert html =~ context.content
end
test "saves new context", %{conn: conn} do
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
assert index_live |> element("a", "New Context") |> render_click() =~
"New Context"
assert index_live |> element("a", "new context") |> render_click() =~
"new context"
assert_patch(index_live, Routes.context_index_path(conn, :new))
@ -46,15 +46,15 @@ defmodule MemexWeb.ContextLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
assert html =~ "Context created successfully"
assert html =~ "context created successfully"
assert html =~ "some content"
end
test "updates context in listing", %{conn: conn, context: context} do
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
assert index_live |> element("#context-#{context.id} a", "Edit") |> render_click() =~
"Edit Context"
assert index_live |> element("#context-#{context.id} a", "edit") |> render_click() =~
"edit context"
assert_patch(index_live, Routes.context_index_path(conn, :edit, context))
@ -68,33 +68,33 @@ defmodule MemexWeb.ContextLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.context_index_path(conn, :index))
assert html =~ "Context updated successfully"
assert html =~ "context updated successfully"
assert html =~ "some updated content"
end
test "deletes context in listing", %{conn: conn, context: context} do
{:ok, index_live, _html} = live(conn, Routes.context_index_path(conn, :index))
assert index_live |> element("#context-#{context.id} a", "Delete") |> render_click()
assert index_live |> element("#context-#{context.id} a", "delete") |> render_click()
refute has_element?(index_live, "#context-#{context.id}")
end
end
describe "Show" do
describe "show" do
setup [:create_context]
test "displays context", %{conn: conn, context: context} do
{:ok, _show_live, html} = live(conn, Routes.context_show_path(conn, :show, context))
assert html =~ "Show Context"
assert html =~ "show context"
assert html =~ context.content
end
test "updates context within modal", %{conn: conn, context: context} do
{:ok, show_live, _html} = live(conn, Routes.context_show_path(conn, :show, context))
assert show_live |> element("a", "Edit") |> render_click() =~
"Edit Context"
assert show_live |> element("a", "edit") |> render_click() =~
"edit context"
assert_patch(show_live, Routes.context_show_path(conn, :edit, context))
@ -108,7 +108,7 @@ defmodule MemexWeb.ContextLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.context_show_path(conn, :show, context))
assert html =~ "Context updated successfully"
assert html =~ "context updated successfully"
assert html =~ "some updated content"
end
end

View File

@ -24,15 +24,15 @@ defmodule MemexWeb.InviteLiveTest do
test "lists all invites", %{conn: conn, invite: invite} do
{:ok, _index_live, html} = live(conn, Routes.invite_index_path(conn, :index))
assert html =~ gettext("Invites")
assert html =~ gettext("invites")
assert html =~ invite.name
end
test "saves new invite", %{conn: conn} do
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
assert index_live |> element("a", dgettext("actions", "Create Invite")) |> render_click() =~
gettext("New Invite")
assert index_live |> element("a", dgettext("actions", "create invite")) |> render_click() =~
gettext("new invite")
assert_patch(index_live, Routes.invite_index_path(conn, :new))
@ -56,7 +56,7 @@ defmodule MemexWeb.InviteLiveTest do
{:ok, index_live, _html} = live(conn, Routes.invite_index_path(conn, :index))
assert index_live |> element("[data-qa=\"edit-#{invite.id}\"]") |> render_click() =~
gettext("Edit Invite")
gettext("edit invite")
assert_patch(index_live, Routes.invite_index_path(conn, :edit, invite))

View File

@ -24,15 +24,15 @@ defmodule MemexWeb.NoteLiveTest do
test "lists all notes", %{conn: conn, note: note} do
{:ok, _index_live, html} = live(conn, Routes.note_index_path(conn, :index))
assert html =~ "Listing Notes"
assert html =~ "notes"
assert html =~ note.content
end
test "saves new note", %{conn: conn} do
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
assert index_live |> element("a", "New Note") |> render_click() =~
"New Note"
assert index_live |> element("a", "new note") |> render_click() =~
"new note"
assert_patch(index_live, Routes.note_index_path(conn, :new))
@ -46,7 +46,7 @@ defmodule MemexWeb.NoteLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
assert html =~ "Note created successfully"
assert html =~ "#{@create_attrs |> Map.get("title")} created"
assert html =~ "some content"
end
@ -54,7 +54,7 @@ defmodule MemexWeb.NoteLiveTest do
{:ok, index_live, _html} = live(conn, Routes.note_index_path(conn, :index))
assert index_live |> element("#note-#{note.id} a", "Edit") |> render_click() =~
"Edit Note"
"edit"
assert_patch(index_live, Routes.note_index_path(conn, :edit, note))
@ -68,7 +68,7 @@ defmodule MemexWeb.NoteLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.note_index_path(conn, :index))
assert html =~ "Note updated successfully"
assert html =~ "#{@update_attrs |> Map.get("title")} saved"
assert html =~ "some updated content"
end
@ -80,21 +80,20 @@ defmodule MemexWeb.NoteLiveTest do
end
end
describe "Show" do
setup [:create_note]
describe "show" do
setup [:register_and_log_in_user, :create_note]
test "displays note", %{conn: conn, note: note} do
{:ok, _show_live, html} = live(conn, Routes.note_show_path(conn, :show, note))
assert html =~ "Show Note"
assert html =~ "show note"
assert html =~ note.content
end
test "updates note within modal", %{conn: conn, note: note} do
{:ok, show_live, _html} = live(conn, Routes.note_show_path(conn, :show, note))
assert show_live |> element("a", "Edit") |> render_click() =~
"Edit Note"
assert show_live |> element("a", "edit") |> render_click() =~ "edit"
assert_patch(show_live, Routes.note_show_path(conn, :edit, note))
@ -108,7 +107,7 @@ defmodule MemexWeb.NoteLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.note_show_path(conn, :show, note))
assert html =~ "Note updated successfully"
assert html =~ "#{@update_attrs |> Map.get("title")} saved"
assert html =~ "some updated content"
end
end

View File

@ -5,7 +5,7 @@ defmodule MemexWeb.HomeLiveTest do
test "disconnected and connected render", %{conn: conn} do
{:ok, page_live, disconnected_html} = live(conn, "/")
assert disconnected_html =~ "Welcome to Memex"
assert render(page_live) =~ "Welcome to Memex"
assert disconnected_html =~ "memex"
assert render(page_live) =~ "memex"
end
end

View File

@ -23,15 +23,15 @@ defmodule MemexWeb.PipelineLiveTest do
test "lists all pipelines", %{conn: conn, pipeline: pipeline} do
{:ok, _index_live, html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert html =~ "Listing Pipelines"
assert html =~ "listing pipelines"
assert html =~ pipeline.description
end
test "saves new pipeline", %{conn: conn} do
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert index_live |> element("a", "New Pipeline") |> render_click() =~
"New Pipeline"
assert index_live |> element("a", "new pipeline") |> render_click() =~
"new pipeline"
assert_patch(index_live, Routes.pipeline_index_path(conn, :new))
@ -45,15 +45,15 @@ defmodule MemexWeb.PipelineLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
assert html =~ "Pipeline created successfully"
assert html =~ "pipeline created successfully"
assert html =~ "some description"
end
test "updates pipeline in listing", %{conn: conn, pipeline: pipeline} do
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert index_live |> element("#pipeline-#{pipeline.id} a", "Edit") |> render_click() =~
"Edit Pipeline"
assert index_live |> element("#pipeline-#{pipeline.id} a", "edit") |> render_click() =~
"edit pipeline"
assert_patch(index_live, Routes.pipeline_index_path(conn, :edit, pipeline))
@ -67,33 +67,33 @@ defmodule MemexWeb.PipelineLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.pipeline_index_path(conn, :index))
assert html =~ "Pipeline updated successfully"
assert html =~ "pipeline updated successfully"
assert html =~ "some updated description"
end
test "deletes pipeline in listing", %{conn: conn, pipeline: pipeline} do
{:ok, index_live, _html} = live(conn, Routes.pipeline_index_path(conn, :index))
assert index_live |> element("#pipeline-#{pipeline.id} a", "Delete") |> render_click()
assert index_live |> element("#pipeline-#{pipeline.id} a", "delete") |> render_click()
refute has_element?(index_live, "#pipeline-#{pipeline.id}")
end
end
describe "Show" do
describe "show" do
setup [:create_pipeline]
test "displays pipeline", %{conn: conn, pipeline: pipeline} do
{:ok, _show_live, html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline))
assert html =~ "Show Pipeline"
assert html =~ "show pipeline"
assert html =~ pipeline.description
end
test "updates pipeline within modal", %{conn: conn, pipeline: pipeline} do
{:ok, show_live, _html} = live(conn, Routes.pipeline_show_path(conn, :show, pipeline))
assert show_live |> element("a", "Edit") |> render_click() =~
"Edit Pipeline"
assert show_live |> element("a", "edit") |> render_click() =~
"edit pipeline"
assert_patch(show_live, Routes.pipeline_show_path(conn, :edit, pipeline))
@ -107,7 +107,7 @@ defmodule MemexWeb.PipelineLiveTest do
|> render_submit()
|> follow_redirect(conn, Routes.pipeline_show_path(conn, :show, pipeline))
assert html =~ "Pipeline updated successfully"
assert html =~ "pipeline updated successfully"
assert html =~ "some updated description"
end
end