diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 09:16:11 +0000 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/graphql/types/merge_request_type_spec.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) | |
download | gitlab-ce-edaa33dee2ff2f7ea3fac488d41558eb5f86d68c.tar.gz |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/graphql/types/merge_request_type_spec.rb')
-rw-r--r-- | spec/graphql/types/merge_request_type_spec.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/graphql/types/merge_request_type_spec.rb b/spec/graphql/types/merge_request_type_spec.rb index b17b7c32289..5ab8845246a 100644 --- a/spec/graphql/types/merge_request_type_spec.rb +++ b/spec/graphql/types/merge_request_type_spec.rb @@ -33,7 +33,7 @@ RSpec.describe GitlabSchema.types['MergeRequest'] do total_time_spent human_time_estimate human_total_time_spent reference author merged_at commit_count current_user_todos conflicts auto_merge_enabled approved_by source_branch_protected default_merge_commit_message_with_description squash_on_merge available_auto_merge_strategies - has_ci mergeable commits_without_merge_commits squash security_auto_fix default_squash_commit_message + has_ci mergeable commits commits_without_merge_commits squash security_auto_fix default_squash_commit_message auto_merge_strategy merge_user ] @@ -133,4 +133,28 @@ RSpec.describe GitlabSchema.types['MergeRequest'] do end end end + + describe '#merge_user' do + let_it_be(:project) { create(:project, :public) } + + context 'when MR is merged' do + let(:merge_request) { create(:merge_request, :with_merged_metrics, target_project: project, source_project: project) } + + it 'is not nil' do + value = resolve_field(:merge_user, merge_request) + + expect(value).not_to be_nil + end + end + + context 'when MR is set to merge when pipeline succeeds' do + let(:merge_request) { create(:merge_request, :merge_when_pipeline_succeeds, target_project: project, source_project: project) } + + it 'is not nil' do + value = resolve_field(:merge_user, merge_request) + + expect(value).not_to be_nil + end + end + end end |