diff --git a/spec/features/officing_spec.rb b/spec/features/officing_spec.rb index 338b416ea..b208b735c 100644 --- a/spec/features/officing_spec.rb +++ b/spec/features/officing_spec.rb @@ -55,7 +55,22 @@ feature 'Poll Officing' do expect(page).to have_content "You do not have permission to access this page" end - scenario 'Access as an poll officer is authorized' do + scenario 'Access as an administrator is not authorized' do + create(:administrator, user: user) + create(:poll) + login_as(user) + visit root_path + + expect(page).to_not have_link("Polling officers") + visit officing_root_path + + expect(current_path).not_to eq(officing_root_path) + expect(current_path).to eq(root_path) + expect(page).to have_content "You do not have permission to access this page" + end + + scenario 'Access as an administrator with poll officer role is authorized' do + create(:administrator, user: user) create(:poll_officer, user: user) create(:poll) login_as(user) @@ -68,8 +83,8 @@ feature 'Poll Officing' do expect(page).to_not have_content "You do not have permission to access this page" end - scenario 'Access as an administrator is authorized' do - create(:administrator, user: user) + scenario 'Access as an poll officer is authorized' do + create(:poll_officer, user: user) create(:poll) login_as(user) visit root_path