ee cummings this shit
This commit is contained in:
@ -9,6 +9,6 @@ defmodule MemexWeb.HomeControllerTest do
|
||||
|
||||
test "GET /", %{conn: conn} do
|
||||
conn = get(conn, "/")
|
||||
assert html_response(conn, 200) =~ "Welcome to Memex"
|
||||
assert html_response(conn, 200) =~ "memex"
|
||||
end
|
||||
end
|
||||
|
@ -12,8 +12,8 @@ defmodule MemexWeb.UserRegistrationControllerTest do
|
||||
test "renders registration page", %{conn: conn} do
|
||||
conn = get(conn, Routes.user_registration_path(conn, :new))
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ dgettext("actions", "Register")
|
||||
assert response =~ dgettext("actions", "Log in")
|
||||
assert response =~ dgettext("actions", "register")
|
||||
assert response =~ dgettext("actions", "log in")
|
||||
end
|
||||
|
||||
test "redirects if already logged in", %{conn: conn} do
|
||||
@ -46,7 +46,7 @@ defmodule MemexWeb.UserRegistrationControllerTest do
|
||||
})
|
||||
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ gettext("Register")
|
||||
assert response =~ gettext("register")
|
||||
assert response =~ "must have the @ sign and no spaces"
|
||||
assert response =~ "should be at least 12 character"
|
||||
end
|
||||
|
@ -16,7 +16,7 @@ defmodule MemexWeb.UserSessionControllerTest do
|
||||
test "renders log in page", %{conn: conn} do
|
||||
conn = get(conn, Routes.user_session_path(conn, :new))
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ dgettext("actions", "Log in")
|
||||
assert response =~ dgettext("actions", "log in")
|
||||
end
|
||||
|
||||
test "redirects if already logged in", %{conn: conn, current_user: current_user} do
|
||||
@ -39,7 +39,7 @@ defmodule MemexWeb.UserSessionControllerTest do
|
||||
conn = get(conn, "/")
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ current_user.email
|
||||
assert response =~ dgettext("prompts", "Are you sure you want to log out?")
|
||||
assert response =~ dgettext("prompts", "are you sure you want to log out?")
|
||||
end
|
||||
|
||||
test "logs the user in with remember me", %{conn: conn, current_user: current_user} do
|
||||
@ -78,7 +78,7 @@ defmodule MemexWeb.UserSessionControllerTest do
|
||||
})
|
||||
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ dgettext("actions", "Log in")
|
||||
assert response =~ dgettext("actions", "log in")
|
||||
assert response =~ dgettext("errors", "Invalid email or password")
|
||||
end
|
||||
end
|
||||
|
@ -59,7 +59,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
|
||||
})
|
||||
|
||||
response = html_response(old_password_conn, 200)
|
||||
assert response =~ gettext("Settings")
|
||||
assert response =~ gettext("settings")
|
||||
assert response =~ dgettext("errors", "should be at least 12 character(s)")
|
||||
assert response =~ dgettext("errors", "does not match password")
|
||||
assert response =~ dgettext("errors", "is not valid")
|
||||
@ -98,7 +98,7 @@ defmodule MemexWeb.UserSettingsControllerTest do
|
||||
})
|
||||
|
||||
response = html_response(conn, 200)
|
||||
assert response =~ gettext("Settings")
|
||||
assert response =~ gettext("settings")
|
||||
assert response =~ dgettext("errors", "must have the @ sign and no spaces")
|
||||
assert response =~ dgettext("errors", "is not valid")
|
||||
end
|
||||
|
@ -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
|
||||
|
@ -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))
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user