Skip to content

Commit

Permalink
test: refactor search
Browse files Browse the repository at this point in the history
  • Loading branch information
trueChazza committed Aug 1, 2023
1 parent 2eb031e commit 4e1430d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/media_server_web/live/search_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,26 @@ defmodule MediaServerWeb.SearchLiveTest do
{:ok, view, _disconnected_html} =
live(conn, Routes.search_index_path(conn, :index, query: "Caminandes"))

assert assert render(view) =~ "Caminandes: Llamigos"
assert assert render(view) =~ "Caminandes: Gran Dillama"
assert assert render(view) =~ "Caminandes: Llama Drama"
assert render(view) =~ "Caminandes: Llamigos"
assert render(view) =~ "Caminandes: Gran Dillama"
assert render(view) =~ "Caminandes: Llama Drama"

assert assert render(view) =~ Routes.movies_show_path(conn, :show, 3)
assert assert render(view) =~ Routes.movies_show_path(conn, :show, 2)
assert assert render(view) =~ Routes.movies_show_path(conn, :show, 1)
assert render(view) =~ Routes.movies_show_path(conn, :show, 3)
assert render(view) =~ Routes.movies_show_path(conn, :show, 2)
assert render(view) =~ Routes.movies_show_path(conn, :show, 1)
end

test "it should normalise movie query", %{conn: conn} do
{:ok, view, _disconnected_html} =
live(conn, Routes.search_index_path(conn, :index, query: "camiNandes"))

assert assert render(view) =~ "Caminandes: Llamigos"
assert assert render(view) =~ "Caminandes: Gran Dillama"
assert assert render(view) =~ "Caminandes: Llama Drama"
assert render(view) =~ "Caminandes: Llamigos"
assert render(view) =~ "Caminandes: Gran Dillama"
assert render(view) =~ "Caminandes: Llama Drama"

assert assert render(view) =~ Routes.movies_show_path(conn, :show, 3)
assert assert render(view) =~ Routes.movies_show_path(conn, :show, 2)
assert assert render(view) =~ Routes.movies_show_path(conn, :show, 1)
assert render(view) =~ Routes.movies_show_path(conn, :show, 3)
assert render(view) =~ Routes.movies_show_path(conn, :show, 2)
assert render(view) =~ Routes.movies_show_path(conn, :show, 1)
end

test "it should search series", %{conn: conn} do
Expand Down

0 comments on commit 4e1430d

Please sign in to comment.