Create SDG stats page
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user