diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-12 15:09:35 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-12 15:09:35 +0300 |
commit | a99c04f0185d6a6b398c37630c392ca84494c0a5 (patch) | |
tree | b5b98085e799c85fff28193566019c6209019c5f /spec/support/shared_examples | |
parent | 135059c00cbc56fd7b7fdc2a6a87c7a94fe64649 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/shared_examples')
-rw-r--r-- | spec/support/shared_examples/serializers/issuable_current_user_properties_shared_examples.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/support/shared_examples/serializers/issuable_current_user_properties_shared_examples.rb b/spec/support/shared_examples/serializers/issuable_current_user_properties_shared_examples.rb new file mode 100644 index 00000000000..6c285bfba91 --- /dev/null +++ b/spec/support/shared_examples/serializers/issuable_current_user_properties_shared_examples.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'issuable entity current_user properties' do + describe 'can_create_confidential_note' do + subject do + described_class.new(resource, request: request) + .as_json[:current_user][:can_create_confidential_note] + end + + context 'when user can create confidential notes' do + before do + resource.resource_parent.add_reporter(user) + end + + it { is_expected.to be(true) } + end + + context 'when user cannot create confidential notes' do + it { is_expected.to eq(false) } + end + end +end |