mirror of
https://codeberg.org/JasterV/spazio-solazzo.git
synced 2026-04-26 18:20:03 +00:00
update tests with new slugs
This commit is contained in:
parent
6e51c2dee2
commit
8c4bf429d0
4 changed files with 13 additions and 13 deletions
|
|
@ -5,21 +5,21 @@ defmodule SpazioSolazzoWeb.CoworkingLiveTest do
|
|||
alias SpazioSolazzo.BookingSystem
|
||||
|
||||
setup do
|
||||
{:ok, space} = BookingSystem.create_space("CoworkingTest", "coworking", "desc", 10)
|
||||
{:ok, space} = BookingSystem.create_space("ArcipelagoTest", "arcipelago", "desc", 10)
|
||||
|
||||
%{space: space}
|
||||
end
|
||||
|
||||
describe "CoworkingLive landing page" do
|
||||
test "renders coworking landing page with space information", %{conn: conn, space: space} do
|
||||
{:ok, _view, html} = live(conn, "/coworking")
|
||||
{:ok, _view, html} = live(conn, "/arcipelago")
|
||||
|
||||
assert html =~ space.name
|
||||
assert html =~ "Fiber Internet"
|
||||
end
|
||||
|
||||
test "has link to space booking page with correct space slug", %{conn: conn, space: space} do
|
||||
{:ok, view, _html} = live(conn, "/coworking")
|
||||
{:ok, _view, html} = live(conn, "/arcipelago")
|
||||
|
||||
assert has_element?(view, "a[href='/book/space/#{space.slug}']")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ defmodule SpazioSolazzoWeb.MeetingLiveTest do
|
|||
alias SpazioSolazzo.BookingSystem
|
||||
|
||||
setup do
|
||||
{:ok, space} = BookingSystem.create_space("MeetingTest", "meeting", "desc", 1)
|
||||
{:ok, space} = BookingSystem.create_space("MediaRoomTest", "media-room", "desc", 1)
|
||||
|
||||
%{space: space}
|
||||
end
|
||||
|
|
@ -15,13 +15,13 @@ defmodule SpazioSolazzoWeb.MeetingLiveTest do
|
|||
conn: conn,
|
||||
space: space
|
||||
} do
|
||||
{:ok, _view, html} = live(conn, "/meeting")
|
||||
{:ok, _view, html} = live(conn, "/media-room")
|
||||
|
||||
assert html =~ space.name
|
||||
end
|
||||
|
||||
test "has link to space booking page with correct space slug", %{conn: conn, space: space} do
|
||||
{:ok, view, _html} = live(conn, "/meeting")
|
||||
{:ok, view, _html} = live(conn, "/media-room")
|
||||
|
||||
assert has_element?(view, "a[href='/book/space/#{space.slug}']")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ defmodule SpazioSolazzoWeb.MusicLiveTest do
|
|||
alias SpazioSolazzo.BookingSystem
|
||||
|
||||
setup do
|
||||
{:ok, space} = BookingSystem.create_space("MusicTest", "music", "desc", 1)
|
||||
{:ok, space} = BookingSystem.create_space("HallTest", "hall", "desc", 1)
|
||||
|
||||
%{space: space}
|
||||
end
|
||||
|
|
@ -15,13 +15,13 @@ defmodule SpazioSolazzoWeb.MusicLiveTest do
|
|||
conn: conn,
|
||||
space: space
|
||||
} do
|
||||
{:ok, _view, html} = live(conn, "/music")
|
||||
{:ok, _view, html} = live(conn, "/hall")
|
||||
|
||||
assert html =~ space.name
|
||||
end
|
||||
|
||||
test "has link to space booking page with correct space slug", %{conn: conn, space: space} do
|
||||
{:ok, view, _html} = live(conn, "/music")
|
||||
{:ok, view, _html} = live(conn, "/hall")
|
||||
|
||||
assert has_element?(view, "a[href='/book/space/#{space.slug}']")
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ defmodule SpazioSolazzoWeb.PageLiveTest do
|
|||
alias SpazioSolazzo.BookingSystem
|
||||
|
||||
setup do
|
||||
for {name, slug} <- [{"Coworking", "coworking"}, {"Meeting", "meeting"}, {"Music", "music"}] do
|
||||
for {name, slug} <- [{"Arcipelago", "arcipelago"}, {"Media Room", "media"}, {"Hall", "hall"}] do
|
||||
BookingSystem.create_space!(name, slug, "desc", 10)
|
||||
end
|
||||
|
||||
|
|
@ -17,8 +17,8 @@ defmodule SpazioSolazzoWeb.PageLiveTest do
|
|||
|
||||
html = render(view)
|
||||
|
||||
assert String.contains?(html, "/coworking")
|
||||
assert String.contains?(html, "/meeting")
|
||||
assert String.contains?(html, "/music")
|
||||
assert String.contains?(html, "/arcipelago")
|
||||
assert String.contains?(html, "/media")
|
||||
assert String.contains?(html, "/hall")
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue