Create SDG stats page

This commit is contained in:
Senén Rodero Rodríguez
2021-01-21 14:56:30 +01:00
parent 4c2d918bb5
commit 9b2d349e21
9 changed files with 57 additions and 0 deletions

View File

@@ -395,4 +395,29 @@ describe "Stats", :admin do
end
end
end
context "SDG", :js do
scenario "Shows SDG stats link when SDG feature is enabled" do
Setting["feature.sdg"] = true
visit admin_stats_path
expect(page).to have_link "SDG", href: sdg_admin_stats_path
end
scenario "Does not show SDG stats link when SDG feature is disbled" do
Setting["feature.sdg"] = false
visit admin_stats_path
expect(page).not_to have_link "SDG"
end
scenario "Renders all goals stats" do
visit sdg_admin_stats_path
expect(page).to have_css "h3", count: SDG::Goal.count
expect(page).to have_css ".sdg-goal-stats", count: SDG::Goal.count
end
end
end