File tree 4 files changed +38
-2
lines changed
app/presenters/content_item
4 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,12 @@ def manual_metadata
51
51
private
52
52
53
53
def other_metadata
54
+ updated_metadata ( public_updated_at )
55
+ end
56
+
57
+ def updated_metadata ( updated_at )
54
58
updates_link = view_context . link_to ( I18n . t ( "manuals.see_all_updates" ) , "#{ base_path } /updates" )
55
- { I18n . t ( "manuals.updated" ) => "#{ display_date ( public_updated_at ) } , #{ updates_link } " }
59
+ { I18n . t ( "manuals.updated" ) => "#{ display_date ( updated_at ) } , #{ updates_link } " }
56
60
end
57
61
58
62
def details
Original file line number Diff line number Diff line change @@ -22,7 +22,16 @@ def breadcrumb
22
22
def manual_content_item
23
23
# TODO: Add the same tagging to a normal section as a manual for contextual breadcrumbs
24
24
# TODO: Add the manual title to the HMRC section content item and then we can remove this request (manual_content_item)
25
+ # TODO: Add the manual published / public updated at to both manual sections (normal and HMRC)
25
26
@manual_content_item ||= Services . content_store . content_item ( base_path )
26
27
end
28
+
29
+ def published
30
+ display_date ( manual_content_item [ "first_published_at" ] )
31
+ end
32
+
33
+ def other_metadata
34
+ updated_metadata ( manual_content_item [ "public_updated_at" ] )
35
+ end
27
36
end
28
37
end
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ class HmrcManualSectionTest < ActionDispatch::IntegrationTest
18
18
assert_has_metadata (
19
19
{
20
20
from : { "HM Revenue & Customs" : "/government/organisations/hm-revenue-customs" } ,
21
- first_published : "10 February 2015" ,
21
+ first_published : "11 February 2015" ,
22
22
other : {
23
23
I18n . t ( "manuals.see_all_updates" ) => "#{ @manual [ 'base_path' ] } /updates" ,
24
24
} ,
Original file line number Diff line number Diff line change @@ -17,6 +17,29 @@ class ManualSectionTest < ActionDispatch::IntegrationTest
17
17
end
18
18
end
19
19
20
+ test "renders metadata" do
21
+ setup_and_visit_manual_section
22
+
23
+ assert_has_metadata (
24
+ {
25
+ from : { "Government Digital Service" : "/government/organisations/government-digital-service" } ,
26
+ first_published : "27 April 2015" ,
27
+ other : {
28
+ I18n . t ( "manuals.see_all_updates" ) => "#{ @manual [ 'base_path' ] } /updates" ,
29
+ } ,
30
+ } ,
31
+ extra_metadata_classes : ".gem-c-metadata--inverse" ,
32
+ )
33
+ end
34
+
35
+ test "renders search box" do
36
+ setup_and_visit_manual_section
37
+
38
+ within ".gem-c-search" do
39
+ assert page . has_text? ( I18n . t ( "manuals.search_this_manual" ) )
40
+ end
41
+ end
42
+
20
43
test "renders document heading" do
21
44
setup_and_visit_manual_section
22
45
You can’t perform that action at this time.
0 commit comments