Skip to content

Commit

Permalink
Change last updated to use published-dates component
Browse files Browse the repository at this point in the history
For consistency we should be using the frontend component that renders the last_updated attribute.
  • Loading branch information
deborahchua committed May 17, 2018
1 parent 49cd505 commit b54c0f3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions app/views/content_items/_body_with_related_links.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
disable_youtube_expansions: true,
rich_govspeak: true %>

<% if @content_item.last_updated %>
<p class="last-updated">
<%= t 'common.last_updated' %>: <%= @content_item.last_updated %>
</p>
<% if @content_item.last_updated && @content_item.schema_name == "help_page" %>
<%= render "components/published-dates", {
last_updated: @content_item.last_updated
} %>
<% end %>
</div>

Expand Down
4 changes: 2 additions & 2 deletions test/integration/help_page_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
class HelpPageTest < ActionDispatch::IntegrationTest
test "renders title and body" do
setup_and_visit_content_item('help_page')
assert page.has_text?(@content_item["title"])

assert page.has_text?("Last updated: 16 December 2014")
assert page.has_text?(@content_item["title"])
assert_has_component_govspeak(@content_item["details"]["body"].squish)
assert_has_published_dates(@content_item["last_updated"])
end
end

0 comments on commit b54c0f3

Please sign in to comment.