Skip to content

Commit

Permalink
Merge pull request #461 from alphagov/add-corp-info-withdrawn-notice
Browse files Browse the repository at this point in the history
Include withdrawn notice on corporate info pages
  • Loading branch information
fofr authored Aug 23, 2017
2 parents 688392b + dd62162 commit 4380c62
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
</div>
</div>
<%= render 'shared/title_and_translations', content_item: @content_item %>
<%= render 'components/notice', @content_item.withdrawal_notice_component %>
<%= render 'components/lead-paragraph', text: @content_item.description %>

<% @additional_body = capture do %>
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ en:
consultation_outcome:
one: Consultation outcome
other: Consultation outcomes
corporate_information_page:
one: Information page
other: Information pages
corporate_report:
one: Corporate report
other: Corporate reports
Expand Down
14 changes: 14 additions & 0 deletions test/integration/corporate_information_page_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,18 @@ class CorporateInformationPageTest < ActionDispatch::IntegrationTest
}
)
end

test 'renders a withdrawal notice on withdrawn page' do
content_item = GovukSchemas::Example.find('corporate_information_page', example_name: 'corporate_information_page')
content_item['withdrawn_notice'] = {
'explanation': 'This is out of date',
'withdrawn_at': '2014-08-09T11:39:05Z'
}
content_store_has_item("/government/organisations/department-of-health/about", content_item.to_json)

visit "/government/organisations/department-of-health/about"

assert page.has_css?(".app-c-notice__title", text: "This information page was withdrawn on 9 August 2014")
assert page.has_css?(".app-c-notice", text: "This is out of date")
end
end

0 comments on commit 4380c62

Please sign in to comment.