Skip to content

Commit

Permalink
HFEYP Privacy Statement (#862)
Browse files Browse the repository at this point in the history
* Add Variables To 'env.example'

Added 'feedback_url' and 'privacy_policy_url' to 'env.example'

* Add Privacy Policy to Footer

Added Privacy Policy to Footer and update application.rb to use the new environment variable

---------

Co-authored-by: dfeetenby <[email protected]>
  • Loading branch information
David-Feetenby and dfeetenby authored Sep 25, 2024
1 parent 0b87de4 commit 7be0c5a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@ ENVIRONMENT=production

RAILS_MASTER_KEY=xxxxxxxxxxxxxxxx
RAILS_LOG_TO_STDOUT=true
#FEEDBACK_URL=
#PRIVACY_POLICY_URL=
2 changes: 2 additions & 0 deletions app/views/layouts/_footer.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -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'
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ en:
links:
footer:
feedback: Feedback
privacy_policy: Privacy policy
admin:
articles:
create:
Expand Down
9 changes: 9 additions & 0 deletions spec/system/homepage_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7be0c5a

Please sign in to comment.