From d367c6fa094417b786118148f4b1f84f89305545 Mon Sep 17 00:00:00 2001 From: Claudio Ortolina Date: Sat, 19 Oct 2024 19:29:40 +0100 Subject: [PATCH] Display purchase date in details --- lib/music_library_web/live/record_live/show.html.heex | 1 + test/music_library_web/live/record_show_test.exs | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/music_library_web/live/record_live/show.html.heex b/lib/music_library_web/live/record_live/show.html.heex index 2a140bb6..b7dc8796 100644 --- a/lib/music_library_web/live/record_live/show.html.heex +++ b/lib/music_library_web/live/record_live/show.html.heex @@ -53,6 +53,7 @@ <%= genre %> + <:item title="Purchased at"><%= @record.purchased_at %> <:item title="Inserted at"><%= @record.inserted_at %> <:item title="Updated at"><%= @record.updated_at %> diff --git a/test/music_library_web/live/record_show_test.exs b/test/music_library_web/live/record_show_test.exs index 9e009dcd..e3ca18e6 100644 --- a/test/music_library_web/live/record_show_test.exs +++ b/test/music_library_web/live/record_show_test.exs @@ -36,6 +36,7 @@ defmodule MusicLibraryWeb.RecordShowTest do assert html =~ Record.format_short_label(record.format) assert html =~ record.release assert html =~ ~p"/covers/#{record.id}?vsn=#{record.cover_hash}" + assert html =~ Phoenix.HTML.Safe.to_iodata(record.purchased_at) assert html =~ Phoenix.HTML.Safe.to_iodata(record.inserted_at) assert html =~ Phoenix.HTML.Safe.to_iodata(record.updated_at)