Skip to content

Commit 05ddb0a

Browse files
committed
Add 'built by' statement to footer
We have this in the product page repo so it makes sense to copy it here for consistency too.
1 parent 349d7af commit 05ddb0a

3 files changed

Lines changed: 24 additions & 3 deletions

File tree

app/views/layouts/application.html.erb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,18 @@
2121
<% end %>
2222

2323
<% content_for :footer do %>
24-
<% meta_links = {t("footer.accessibility_statement") => "https://www.forms.service.gov.uk/accessibility", t("footer.cookies") => "https://www.forms.service.gov.uk/cookies", t("footer.privacy") => "https://www.forms.service.gov.uk/privacy", t("footer.terms_of_use") => "https://www.forms.service.gov.uk/terms-of-use"} %>
25-
<%= govuk_footer meta_items_title: t("footer.helpful_links"), meta_items: meta_links %>
24+
<% meta_items = {t("footer.accessibility_statement") => "https://www.forms.service.gov.uk/accessibility", t("footer.cookies") => "https://www.forms.service.gov.uk/cookies", t("footer.privacy") => "https://www.forms.service.gov.uk/privacy", t("footer.terms_of_use") => "https://www.forms.service.gov.uk/terms-of-use"} %>
25+
26+
<%= govuk_footer meta_items_title: t("footer.helpful_links"), meta_items: do |footer| %>
27+
<%= footer.with_meta_html do %>
28+
<div class="govuk-footer__meta-custom">
29+
<%= t("footer.built_by_statement_html",
30+
link: link_to(t("footer.built_by_link"),
31+
"https://www.gov.uk/government/organisations/government-digital-service",
32+
class: ["govuk-footer__link"])) %>
33+
</div>
34+
<% end %>
35+
<% end %>
2636
<% end %>
2737

2838
<%= render template: "layouts/base" %>

config/locales/en.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ en:
310310
no_content_added_html: "<p>No content added</p>"
311311
footer:
312312
accessibility_statement: Accessibility statement
313+
built_by_link: Government Digital Service
314+
built_by_statement_html: Built by the %{link}
313315
cookies: Cookies
314316
helpful_links: Helpful links
315317
privacy: Privacy

spec/requests/application_controller_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,22 @@
232232
end
233233

234234
describe "footer" do
235-
it "contains links related to the service" do
235+
before do
236236
get root_path
237+
end
237238

239+
it "contains links related to the service" do
238240
expect(response.body).to include('<a class="govuk-footer__link" href="https://www.forms.service.gov.uk/accessibility">Accessibility statement</a>')
239241
expect(response.body).to include('<a class="govuk-footer__link" href="https://www.forms.service.gov.uk/cookies">Cookies</a>')
240242
expect(response.body).to include('<a class="govuk-footer__link" href="https://www.forms.service.gov.uk/privacy">Privacy</a>')
241243
expect(response.body).to include('<a class="govuk-footer__link" href="https://www.forms.service.gov.uk/terms-of-use">Terms of use</a>')
242244
end
245+
246+
it "contains the 'built by' statement" do
247+
page = Capybara::Node::Simple.new(response.body)
248+
249+
expect(page).to have_text("Built by the")
250+
expect(page).to have_link("Government Digital Service", href: "https://www.gov.uk/government/organisations/government-digital-service")
251+
end
243252
end
244253
end

0 commit comments

Comments
 (0)