diff --git a/.env.example b/.env.example index 69ca86e5..907b1c17 100644 --- a/.env.example +++ b/.env.example @@ -31,3 +31,5 @@ ENVIRONMENT=production RAILS_MASTER_KEY=xxxxxxxxxxxxxxxx RAILS_LOG_TO_STDOUT=true +#FEEDBACK_URL= +#PRIVACY_POLICY_URL= diff --git a/app/views/layouts/_footer.html.slim b/app/views/layouts/_footer.html.slim index c6b9ea57..2d69e64b 100644 --- a/app/views/layouts/_footer.html.slim +++ b/app/views/layouts/_footer.html.slim @@ -4,6 +4,8 @@ ul.govuk-footer__list.govuk-footer__list--columns-3 li.govuk-footer__list-item = govuk_link_to t('links.footer.feedback'), Rails.configuration.feedback_url, class: 'govuk-footer__link' + li.govuk-footer__list-item + = govuk_link_to t('links.footer.privacy_policy'), Rails.configuration.privacy_policy_url, class: 'govuk-footer__link' - Page.footer.pages.each do |page| li.govuk-footer__list-item = govuk_link_to page.title, page.path, class: 'govuk-footer__link' diff --git a/config/application.rb b/config/application.rb index 4cd157bc..d9bd2d64 100644 --- a/config/application.rb +++ b/config/application.rb @@ -39,6 +39,7 @@ class Application < Rails::Application config.i18n.load_path += Dir[Rails.root.join('config/locales/content/*.{rb,yml}').to_s] config.feedback_url = ENV.fetch('FEEDBACK_URL', '#FEEDBACK_env_var_missing') + config.privacy_policy_url = ENV.fetch('PRIVACY_POLICY_URL', '#PRIVACY_POLICY_env_var_missing') config.signup_url = ENV.fetch('SIGNUP_URL', '#SIGNUP_env_var_missing') config.tracking_id = ENV.fetch('TRACKING_ID', '#TRACKING_ID_env_var_missing') config.js_url = "https://www.googletagmanager.com/gtag/js?id=#{config.tracking_id}" diff --git a/config/locales/en.yml b/config/locales/en.yml index f1e743de..a91904f3 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -22,6 +22,7 @@ en: links: footer: feedback: Feedback + privacy_policy: Privacy policy admin: articles: create: diff --git a/spec/system/homepage_spec.rb b/spec/system/homepage_spec.rb index 492ab0a1..969efaf0 100644 --- a/spec/system/homepage_spec.rb +++ b/spec/system/homepage_spec.rb @@ -18,4 +18,13 @@ # Check for the feedback link/button expect(page).to have_link(href: Rails.configuration.feedback_url) end + + # Check for the footer links + it 'displays the feedback link' do + expect(page).to have_link(I18n.t('links.footer.feedback'), href: Rails.configuration.feedback_url) + end + + it 'displays the privacy policy link' do + expect(page).to have_link(I18n.t('links.footer.privacy_policy'), href: Rails.configuration.privacy_policy_url) + end end