>
<%= link_to new_officing_poll_voter_path(Poll.last) do %>
diff --git a/spec/features/admin_spec.rb b/spec/features/admin_spec.rb
index 9ef1b334e..8b72ee839 100644
--- a/spec/features/admin_spec.rb
+++ b/spec/features/admin_spec.rb
@@ -16,7 +16,7 @@ feature 'Admin' do
expect(page).to have_content "You do not have permission to access this page"
end
- scenario 'Access as a moderator is not authorized' do
+ scenario 'Access as moderator is not authorized' do
create(:moderator, user: user)
login_as(user)
visit admin_root_path
@@ -26,7 +26,7 @@ feature 'Admin' do
expect(page).to have_content "You do not have permission to access this page"
end
- scenario 'Access as a valuator is not authorized' do
+ scenario 'Access as valuator is not authorized' do
create(:valuator, user: user)
login_as(user)
visit admin_root_path
@@ -36,7 +36,7 @@ feature 'Admin' do
expect(page).to have_content "You do not have permission to access this page"
end
- scenario 'Access as a manager is not authorized' do
+ scenario 'Access as manager is not authorized' do
create(:manager, user: user)
login_as(user)
visit admin_root_path
@@ -46,7 +46,17 @@ feature 'Admin' do
expect(page).to have_content "You do not have permission to access this page"
end
- scenario 'Access as an administrator is authorized' do
+ scenario 'Access as poll officer is not authorized' do
+ create(:poll_officer, user: user)
+ login_as(user)
+ visit admin_root_path
+
+ expect(current_path).not_to eq(admin_root_path)
+ expect(current_path).to eq(proposals_path)
+ expect(page).to have_content "You do not have permission to access this page"
+ end
+
+ scenario 'Access as administrator is authorized' do
login_as(administrator)
visit admin_root_path
diff --git a/spec/features/moderation_spec.rb b/spec/features/moderation_spec.rb
index 6607ec48a..fedcb105d 100644
--- a/spec/features/moderation_spec.rb
+++ b/spec/features/moderation_spec.rb
@@ -43,6 +43,20 @@ feature 'Moderation' do
expect(page).to have_content "You do not have permission to access this page"
end
+ scenario 'Access as poll officer is not authorized' do
+ create(:poll_officer, user: user)
+
+ login_as(user)
+ visit root_path
+
+ expect(page).to_not have_link("Moderation")
+ visit moderation_root_path
+
+ expect(current_path).not_to eq(moderation_root_path)
+ expect(current_path).to eq(proposals_path)
+ expect(page).to have_content "You do not have permission to access this page"
+ end
+
scenario 'Access as a moderator is authorized' do
create(:moderator, user: user)
diff --git a/spec/features/valuation_spec.rb b/spec/features/valuation_spec.rb
index fab16027a..6dc52449c 100644
--- a/spec/features/valuation_spec.rb
+++ b/spec/features/valuation_spec.rb
@@ -41,6 +41,19 @@ feature 'Valuation' do
expect(page).to have_content "You do not have permission to access this page"
end
+ scenario 'Access as poll officer is not authorized' do
+ create(:poll_officer, user: user)
+ login_as(user)
+ visit root_path
+
+ expect(page).to_not have_link("Valuation")
+ visit valuation_root_path
+
+ expect(current_path).not_to eq(valuation_root_path)
+ expect(current_path).to eq(proposals_path)
+ expect(page).to have_content "You do not have permission to access this page"
+ end
+
scenario 'Access as a valuator is authorized' do
create(:valuator, user: user)
login_as(user)