Generate project

Using `mix phx.new music_library --database sqlite3 --binary-id --no-mailer`
This commit is contained in:
Claudio Ortolina
2024-09-12 14:05:08 +01:00
commit d547ee6f8d
44 changed files with 2535 additions and 0 deletions
@@ -0,0 +1,14 @@
defmodule MusicLibraryWeb.ErrorHTMLTest do
use MusicLibraryWeb.ConnCase, async: true
# Bring render_to_string/4 for testing custom views
import Phoenix.Template
test "renders 404.html" do
assert render_to_string(MusicLibraryWeb.ErrorHTML, "404", "html", []) == "Not Found"
end
test "renders 500.html" do
assert render_to_string(MusicLibraryWeb.ErrorHTML, "500", "html", []) == "Internal Server Error"
end
end
@@ -0,0 +1,12 @@
defmodule MusicLibraryWeb.ErrorJSONTest do
use MusicLibraryWeb.ConnCase, async: true
test "renders 404" do
assert MusicLibraryWeb.ErrorJSON.render("404.json", %{}) == %{errors: %{detail: "Not Found"}}
end
test "renders 500" do
assert MusicLibraryWeb.ErrorJSON.render("500.json", %{}) ==
%{errors: %{detail: "Internal Server Error"}}
end
end
@@ -0,0 +1,8 @@
defmodule MusicLibraryWeb.PageControllerTest do
use MusicLibraryWeb.ConnCase
test "GET /", %{conn: conn} do
conn = get(conn, ~p"/")
assert html_response(conn, 200) =~ "Peace of mind from prototype to production"
end
end