diff --git a/app/components/shared/agree_with_terms_of_service_field_component.rb b/app/components/shared/agree_with_terms_of_service_field_component.rb index 808dbe812..49dcbd256 100644 --- a/app/components/shared/agree_with_terms_of_service_field_component.rb +++ b/app/components/shared/agree_with_terms_of_service_field_component.rb @@ -9,7 +9,8 @@ class Shared::AgreeWithTermsOfServiceFieldComponent < ApplicationComponent def label t("form.accept_terms", - policy: link_to(t("form.policy"), "/privacy", target: "_blank"), - conditions: link_to(t("form.conditions"), "/conditions", target: "_blank")) + policy: link_to(t("form.policy"), "/privacy", target: "_blank", title: t("shared.target_blank")), + conditions: link_to(t("form.conditions"), "/conditions", target: "_blank", + title: t("shared.target_blank"))) end end diff --git a/spec/components/shared/agree_with_terms_of_service_field_component_spec.rb b/spec/components/shared/agree_with_terms_of_service_field_component_spec.rb index 6b7c8bc7a..455346b7f 100644 --- a/spec/components/shared/agree_with_terms_of_service_field_component_spec.rb +++ b/spec/components/shared/agree_with_terms_of_service_field_component_spec.rb @@ -18,4 +18,13 @@ describe Shared::AgreeWithTermsOfServiceFieldComponent do expect(page).to have_css "a[target=_blank]", count: 2 end + + it "contains links indicating they open in a new window" do + render_inline component + + expect(page).to have_link count: 2 + expect(page).to have_link "Privacy Policy" + expect(page).to have_link "Terms and conditions of use" + expect(page).to have_link " (link opens in new window)", count: 2 + end end