Add sdg help page

In this page we will render a list of clickable Goals icons that will show their
targets and related local targets

Co-authored-by: Senen <senenrodero@gmail.com>
This commit is contained in:
taitus
2021-02-10 18:43:14 +01:00
parent d741ccdb36
commit d26607183e
12 changed files with 134 additions and 3 deletions

View File

@@ -140,4 +140,34 @@ describe "SDG Goals", :js do
end
end
end
describe "Help" do
scenario "shows all SDGs targets" do
create(:sdg_local_target, code: "15.1.1", title: "SDG local target sample text")
visit sdg_help_path
expect(page).to have_content "You can align your contributions to the community"
expect(page).to have_css "h2", exact_text: "1. No Poverty"
expect(page).to have_content "End poverty in all its forms, everywhere."
expect(page).to have_content "1.1 By 2030, eradicate extreme poverty for all people everywhere"
click_link "7. Affordable and Clean Energy"
expect(page).not_to have_css "h2", exact_text: "1. No Poverty"
expect(page).to have_css "h2", exact_text: "7. Affordable and Clean Energy"
expect(page).to have_content "Ensure access to affordable, reliable, sustainable and modern energy."
expect(page).to have_content "7.1 By 2030, ensure universal access to affordable"
click_link "15. Life on Land"
expect(page).to have_css "h2", exact_text: "15. Life on Land"
expect(page).to have_content "Sustainably manage forests, combat desertification, halt and reverse"
expect(page).to have_content "15.1 By 2020, ensure the conservation, restoration and sustainable use"
click_link "Local targets"
expect(page).not_to have_content "15.1 By 2020, ensure the conservation, restoration and sustainable use"
expect(page).to have_content "SDG local target sample text"
end
end
end