Commit b45bf750 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider

fix some policy specs

parent 2ce3e8ac
Pipeline #38214 passed with stage
in 45 minutes and 25 seconds
image: git.panter.ch:5001/panter/gitlab-ci-docker-images/ruby-and-rails:ruby-2.4.5-node-8-imgmgk-chrome
image: git.panter.ch:5001/panter/gitlab-ci-docker-images/ruby-and-rails:ruby-2.4.5-node8-chrome-imagemagick
stages:
- test
......
......@@ -2,7 +2,7 @@ require 'test_helper'
class AssignmentPolicyTest < PolicyAssertions::Test
test 'superadmin_can_use_all_actions' do
assert_permit(create(:user), Assignment, *actions_list, 'show_comments?')
assert_permit(create(:user), Assignment, *actions_list(except: [:reactivate]), 'show_comments?')
end
test 'department_manager_has_limited_access' do
......
......@@ -2,7 +2,7 @@ require 'test_helper'
class GroupAssignmentPolicyTest < PolicyAssertions::Test
test 'superadmin_can_use_all_actions' do
assert_permit(create(:user), GroupAssignment, *actions_list, 'show_comments?')
assert_permit(create(:user), GroupAssignment, *actions_list(except: [:reactivate]), 'show_comments?')
end
test 'department_manager without department has read-only access' do
......@@ -59,6 +59,7 @@ class GroupAssignmentPolicyTest < PolicyAssertions::Test
end
private
def index_actions
actions_list(:terminated_index, :hours_and_feedbacks_submitted)
end
......
......@@ -3,7 +3,7 @@ require 'test_helper'
class VolunteerPolicyTest < PolicyAssertions::Test
test 'superadmin_can_use_all_actions' do
assert_permit(create(:user), Volunteer,
'superadmin_privileges?', 'show_comments?', *actions_list)
'superadmin_privileges?', 'show_comments?', *actions_list(except: [:reactivate]))
end
test 'department_manager has full access to volunteers in their departments' do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment