From 61ad64c023177c514544283ac1255c8091489663 Mon Sep 17 00:00:00 2001 From: Katherine Martin <78093815+martikat@users.noreply.github.com> Date: Fri, 19 Apr 2024 09:40:55 +0100 Subject: [PATCH] Delete system spec and update side nav citation component logic --- app/views/pages/side_nav.slim | 4 +- spec/system/page_tier_spec.rb | 112 ---------------------------------- 2 files changed, 3 insertions(+), 113 deletions(-) delete mode 100644 spec/system/page_tier_spec.rb diff --git a/app/views/pages/side_nav.slim b/app/views/pages/side_nav.slim index 804999ce..e74bbadb 100644 --- a/app/views/pages/side_nav.slim +++ b/app/views/pages/side_nav.slim @@ -30,8 +30,10 @@ = render 'debug' = m(page.body) - - if page.content_list.present? + - if page.pages.blank? = render 'shared/citation' + + - if page.content_list.present? = render 'shared/back_to_top' = render 'shared/print' diff --git a/spec/system/page_tier_spec.rb b/spec/system/page_tier_spec.rb deleted file mode 100644 index fec4be0e..00000000 --- a/spec/system/page_tier_spec.rb +++ /dev/null @@ -1,112 +0,0 @@ -require 'rails_helper' - -RSpec.describe 'First/Second/Third tier pages' do - describe 'First tier page' do - before do - visit '/areas-of-learning' - end - - it 'has a heading' do - within '#hero-layout' do - expect(page).to have_text('Areas of learning') - end - end - - it 'has a body' do - within '#hero-layout' do - expect(page.body).to be_present - end - end - - it 'has a call to action component' do - within '.hf-ctas' do - expect(page).to have_text('Help to improve this website') - end - end - - it 'has other resources' do - within '.hf-other' do - expect(page).to have_text('Other early years resources from the Department for Education') - end - end - end - - describe 'Second tier page' do - before do - visit '/areas-of-learning/communication-and-language' - end - - it 'has a heading' do - expect(page).to have_text('Overview') - end - - # This currently renders govuk-heading-l for this h2 (does not match styling for third tier page) - xit 'renders h2 as govuk-heading-m' do - within '#communication-and-language-resources' do - expect(page).to include 'govuk-heading-m' - end - end - - it 'has a body' do - expect(page.body).to be_present - end - - it 'has a call to action component' do - within '.hf-ctas' do - expect(page).to have_text('Help to improve this website') - end - end - - it 'has content footer component' do - within '.cta-banner' do - expect(page).to have_text('Early years child development training') - end - end - end - - describe 'Third tier page' do - before do - visit '/areas-of-learning/communication-and-language/interactions' - end - - it 'has a page title' do - expect(page.title).to eq('Help for early years providers : Interactions') - end - - it 'has a contents list' do - within '.contents-on-page' do - expect(page).to have_text('Contents on this page') - end - end - - it 'has a print this page button' do - expect(page).to have_text('Print this page') - end - - it 'has a body' do - expect(page.body).to be_present - end - - it 'renders h2 as govuk-heading-m' do - within '#why-interactions-are-important' do - expect(page.body).to include 'govuk-heading-m' - end - end - - it 'has a back to top button' do - expect(page).to have_text('Back to top') - end - - it 'has a call to action component' do - within '.hf-ctas' do - expect(page).to have_text('Help to improve this website') - end - end - - it 'has content footer component' do - within '.cta-banner' do - expect(page).to have_text('Early years child development training') - end - end - end -end