Remove Processes link on help page when legislation is disabled

This commit is contained in:
Senén Rodero Rodríguez
2022-07-13 13:25:22 +02:00
committed by taitus
parent 299ca4cee6
commit 0ccfac76ad
2 changed files with 25 additions and 5 deletions

View File

@@ -29,11 +29,13 @@
class: "button hollow expanded"
] if feature?(:polls)
),
[
t("pages.help.menu.processes"),
"#processes",
class: "button hollow expanded"
],
(
[
t("pages.help.menu.processes"),
"#processes",
class: "button hollow expanded"
] if feature?(:legislation)
),
[
t("pages.help.menu.other"),
"#other",

View File

@@ -56,4 +56,22 @@ describe "Help page" do
expect(page).not_to have_link "Sustainable Development Goals help"
end
scenario "renders the legislation section link when the process is enabled" do
Setting["feature.help_page"] = true
Setting["process.legislation"] = true
visit page_path("help")
expect(page).to have_link "Processes", href: "#processes"
end
scenario "does not render the legislation section link when the process is disabled" do
Setting["feature.help_page"] = true
Setting["process.legislation"] = nil
visit page_path("help")
expect(page).not_to have_link "Processes"
end
end