diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6e269614..f3c55b58 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,6 +9,7 @@ <%= stylesheet_link_tag "print", media: "print" %> <%= javascript_include_tag "application" %> <%= csrf_meta_tags %> + <%= yield :extra_headers %> diff --git a/app/views/manuals/index.html.erb b/app/views/manuals/index.html.erb index 80304a7c..27bba020 100644 --- a/app/views/manuals/index.html.erb +++ b/app/views/manuals/index.html.erb @@ -1,3 +1,9 @@ +<% content_for :extra_headers do %> + <% if @manual.summary.present? %> + + <% end %> +<% end %> + <% content_for :title, @manual.full_title %>
<%= render partial: "header" %> diff --git a/spec/features/viewing_a_manual_spec.rb b/spec/features/viewing_a_manual_spec.rb index 0d544368..b8480d37 100644 --- a/spec/features/viewing_a_manual_spec.rb +++ b/spec/features/viewing_a_manual_spec.rb @@ -42,6 +42,12 @@ expect(page.response_headers['X-Robots-Tag']).to eq("none") end + scenario "viewing a manual with a description" do + stub_fake_manual + visit_manual "my-manual-about-burritos" + expect(page).to have_selector('meta[name="description"][content="Burrito means little donkey"]', visible: false) + end + scenario "viewing a manual section with subsections" do stub_hmrc_manual stub_hmrc_manual_section_with_subsections