diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-22 18:09:28 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-22 18:09:28 +0300 |
commit | d1cb802bac5dc182342adb9b8f71dbf466cfa501 (patch) | |
tree | 9dc47ce978df2b05a973555a88a1f0b835f4645f /spec/serializers/merge_request_widget_entity_spec.rb | |
parent | 2c171fdd723a6a1f45dedd12e62f93745318b40e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers/merge_request_widget_entity_spec.rb')
-rw-r--r-- | spec/serializers/merge_request_widget_entity_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/serializers/merge_request_widget_entity_spec.rb b/spec/serializers/merge_request_widget_entity_spec.rb index aaee47fb981..795e73789d1 100644 --- a/spec/serializers/merge_request_widget_entity_spec.rb +++ b/spec/serializers/merge_request_widget_entity_spec.rb @@ -31,6 +31,28 @@ RSpec.describe MergeRequestWidgetEntity do end end + describe 'can_create_pipeline_in_target_project' do + context 'when user has permission' do + before do + project.add_developer(user) + end + + it 'includes the correct permission info' do + expect(subject[:can_create_pipeline_in_target_project]).to eq(true) + end + end + + context 'when user does not have permission' do + before do + project.add_guest(user) + end + + it 'includes the correct permission info' do + expect(subject[:can_create_pipeline_in_target_project]).to eq(false) + end + end + end + describe 'issues links' do it 'includes issues links when requested' do data = described_class.new(resource, request: request, issues_links: true).as_json |