Add sdg manager section to admin

Allow a user to become an sdg manager
This commit is contained in:
taitus
2020-11-25 18:57:19 +01:00
committed by Javi Martín
parent fb5965fe63
commit 9fe24aec9d
24 changed files with 301 additions and 0 deletions

View File

@@ -42,6 +42,16 @@ describe "Admin" do
expect(page).to have_content "You do not have permission to access this page"
end
scenario "Access as SDG manager is not authorized", :js do
create(:sdg_manager, user: user)
login_as(user)
visit admin_root_path
expect(page).not_to have_current_path(admin_root_path)
expect(page).to have_current_path(root_path)
expect(page).to have_content "You do not have permission to access this page"
end
scenario "Access as poll officer is not authorized" do
login_as(create(:poll_officer).user)
visit admin_root_path
@@ -59,12 +69,15 @@ describe "Admin" do
end
scenario "Admin access links", :admin do
Setting["feature.sdg"] = true
visit root_path
expect(page).to have_link("Administration")
expect(page).to have_link("Moderation")
expect(page).to have_link("Valuation")
expect(page).to have_link("Management")
expect(page).to have_link("SDG content")
end
scenario "Admin dashboard", :admin do