Skip to content

Commit

Permalink
Display a viewed at timestamp on a teacher record
Browse files Browse the repository at this point in the history
As part of the audit trail for users to be able to prove they performed
a search on a certain day, we want to include a timestamp on the page.

We can simply display the current time and date of when the page was
rendered.
  • Loading branch information
felixclack committed Jul 19, 2024
1 parent c9b5d7b commit 8537612
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/views/check_records/teachers/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<% content_for :page_title, @teacher.name %>
<% content_for :breadcrumbs, govuk_breadcrumbs(breadcrumbs: { "Home" => check_records_search_path, "Search results" => url_for(:back), @teacher.name => nil}) %>
<% content_for :breadcrumbs do %>
<%= govuk_breadcrumbs(breadcrumbs: { "Home" => check_records_search_path, "Search results" => url_for(:back), @teacher.name => nil}) %>
<span class="govuk-caption-m">
Viewed at <%= Time.current.strftime("%-I:%M%P on %-d %B %Y") %>
</span>
<% end %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
then_i_see_npq_details
then_i_see_mq_details
then_i_see_previous_last_names
and_a_viewed_timestamp_is_displayed
end

private
Expand Down Expand Up @@ -113,4 +114,8 @@ def then_i_see_previous_last_names
def and_a_search_timestamp_is_displayed
expect(page).to have_content "Searched at #{@frozen_time.strftime("%-I:%M%P on %-d %B %Y")}"
end

def and_a_viewed_timestamp_is_displayed
expect(page).to have_content "Viewed at #{@frozen_time.strftime("%-I:%M%P on %-d %B %Y")}"
end
end

0 comments on commit 8537612

Please sign in to comment.