diff options
Diffstat (limited to 'spec/policies/work_item_policy_spec.rb')
-rw-r--r-- | spec/policies/work_item_policy_spec.rb | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/policies/work_item_policy_spec.rb b/spec/policies/work_item_policy_spec.rb index 3d282271d60..bd8f5604eba 100644 --- a/spec/policies/work_item_policy_spec.rb +++ b/spec/policies/work_item_policy_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe WorkItemPolicy do +RSpec.describe WorkItemPolicy, feature_category: :team_planning do let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project, group: group) } let_it_be(:public_project) { create(:project, :public, group: group) } @@ -201,4 +201,24 @@ RSpec.describe WorkItemPolicy do end end end + + describe 'admin_work_item_link' do + context 'when user is not a member of the project' do + let(:current_user) { non_member_user } + + it { is_expected.to be_disallowed(:admin_work_item_link) } + end + + context 'when user is guest' do + let(:current_user) { guest } + + it { is_expected.to be_allowed(:admin_work_item_link) } + end + + context 'when user is reporter' do + let(:current_user) { reporter } + + it { is_expected.to be_allowed(:admin_work_item_link) } + end + end end |