mirror of
https://codeberg.org/JasterV/spazio-solazzo.git
synced 2026-04-27 02:25:40 +00:00
32 lines
929 B
Elixir
32 lines
929 B
Elixir
defmodule SpazioSolazzoWeb.MusicLiveTest do
|
|
use SpazioSolazzoWeb.ConnCase
|
|
import Phoenix.LiveViewTest
|
|
|
|
alias SpazioSolazzo.BookingSystem
|
|
|
|
setup do
|
|
{:ok, space} = BookingSystem.create_space("MusicTest", "music", "desc")
|
|
{:ok, asset} = BookingSystem.create_asset("Studio", space.id)
|
|
|
|
%{space: space, asset: asset}
|
|
end
|
|
|
|
describe "MusicLive landing page" do
|
|
test "renders music landing page with space information", %{
|
|
conn: conn,
|
|
space: space
|
|
} do
|
|
{:ok, view, html} = live(conn, "/music")
|
|
|
|
assert html =~ space.name
|
|
assert html =~ "Book This Room"
|
|
assert has_element?(view, "h2", "Jam, Practice, Create")
|
|
end
|
|
|
|
test "has link to asset booking page with correct asset id", %{conn: conn, asset: asset} do
|
|
{:ok, view, _html} = live(conn, "/music")
|
|
|
|
assert has_element?(view, "a[href='/book/asset/#{asset.id}']", "Book This Room")
|
|
end
|
|
end
|
|
end
|