Allow open link on new window

While trying to add the target="_blank" to this link I noticed that this attribute
no longer works in some places in the application, such as the terms and
conditions  link in the sign_up page.

For the time being I think we can resolve it this way in this case and deal with
this issue in a separate PR.
This commit is contained in:
taitus
2021-02-11 11:38:09 +01:00
parent e91b52ffe0
commit 90f014f639
2 changed files with 12 additions and 1 deletions

View File

@@ -16,7 +16,8 @@
link: link_to(t("sdg.related_list_selector.help.text"),
sdg_help_path,
title: t("shared.target_blank"),
target: "_blank"))),
target: "_blank")),
attributes: %w[href title target]),
data: { "suggestions-list": sdg_related_suggestions,
"remove-tag-text": t("sdg.related_list_selector.remove_tag") } %>
</div>

View File

@@ -413,6 +413,16 @@ describe "SDG Relations", :js do
expect(find("input[data-code='1']")).to be_checked
end
end
scenario "Help page link opens in new window" do
process = create(:legislation_process, title: "SDG process")
visit sdg_management_edit_legislation_process_path(process)
within_window(window_opened_by { click_link "SDG help page" }) do
expect(page).to have_content "Sustainable Development Goals help"
end
end
end
describe "help section" do