diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 06:09:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-07 06:09:15 +0300 |
commit | 7ba5b9babaa5802c39e686c57cbf4a3f4725c4b0 (patch) | |
tree | 03a696c26f32e46faa46dd12d0a937d1d0d1cba4 /spec/services/merge_requests | |
parent | b56027c9d80ac0e297ba8a43c81e8504172dbf9f (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/merge_requests')
-rw-r--r-- | spec/services/merge_requests/merge_service_spec.rb | 17 | ||||
-rw-r--r-- | spec/services/merge_requests/post_merge_service_spec.rb | 1 | ||||
-rw-r--r-- | spec/services/merge_requests/squash_service_spec.rb | 18 |
3 files changed, 1 insertions, 35 deletions
diff --git a/spec/services/merge_requests/merge_service_spec.rb b/spec/services/merge_requests/merge_service_spec.rb index 2283f480895..fa7f745d8a0 100644 --- a/spec/services/merge_requests/merge_service_spec.rb +++ b/spec/services/merge_requests/merge_service_spec.rb @@ -47,23 +47,6 @@ describe MergeRequests::MergeService do expect(note.note).to include 'merged' end - it 'is idempotent' do - repository = project.repository - commit_count = repository.commit_count - merge_commit = merge_request.merge_commit.id - - # a first invocation of execute is performed on the before block - service.execute(merge_request) - - expect(merge_request.merge_error).to be_falsey - expect(merge_request).to be_valid - expect(merge_request).to be_merged - - expect(repository.commits_by(oids: [merge_commit]).size).to eq(1) - expect(repository.commit_count).to eq(commit_count) - expect(merge_request.in_progress_merge_commit_sha).to be_nil - end - context 'when squashing' do let(:merge_params) do { commit_message: 'Merge commit message', diff --git a/spec/services/merge_requests/post_merge_service_spec.rb b/spec/services/merge_requests/post_merge_service_spec.rb index 06735d25ad5..fff6ddf3928 100644 --- a/spec/services/merge_requests/post_merge_service_spec.rb +++ b/spec/services/merge_requests/post_merge_service_spec.rb @@ -17,6 +17,7 @@ describe MergeRequests::PostMergeService do it 'refreshes the number of open merge requests for a valid MR', :use_clean_rails_memory_store_caching do # Cache the counter before the MR changed state. project.open_merge_requests_count + merge_request.update!(state: 'merged') service = described_class.new(project, user, {}) diff --git a/spec/services/merge_requests/squash_service_spec.rb b/spec/services/merge_requests/squash_service_spec.rb index 4636f26bb16..cb278eec692 100644 --- a/spec/services/merge_requests/squash_service_spec.rb +++ b/spec/services/merge_requests/squash_service_spec.rb @@ -137,24 +137,6 @@ describe MergeRequests::SquashService do include_examples 'the squash succeeds' end - context 'when the merge request has already been merged' do - let(:merge_request) { merge_request_with_one_commit } - - it 'checks the side-effects for multiple calls' do - merge_request.mark_as_merged - - expect(service).to be_idempotent - expect { IdempotentWorkerHelper::WORKER_EXEC_TIMES.times { service.execute } }.not_to raise_error - end - - it 'idempotently returns a success' do - merge_request.mark_as_merged - result = service.execute - - expect(result).to match(status: :success, squash_sha: merge_request.diff_head_sha) - end - end - context 'git errors' do let(:merge_request) { merge_request_with_only_new_files } let(:error) { 'A test error' } |