diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-24 18:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-24 18:10:36 +0300 |
commit | 234dc40a12a1cdaef0cdb825ca4acc3f271c6394 (patch) | |
tree | fb9875dca8b558acafa54c36a591b4d2ed10fc49 /spec/services/merge_requests | |
parent | c7864d3d50b4002c621c7cba2e1ebfb5d23ac7ed (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 | 15 | ||||
-rw-r--r-- | spec/services/merge_requests/squash_service_spec.rb | 17 |
2 files changed, 0 insertions, 32 deletions
diff --git a/spec/services/merge_requests/merge_service_spec.rb b/spec/services/merge_requests/merge_service_spec.rb index b3af4d67896..e3f33304aab 100644 --- a/spec/services/merge_requests/merge_service_spec.rb +++ b/spec/services/merge_requests/merge_service_spec.rb @@ -402,21 +402,6 @@ RSpec.describe MergeRequests::MergeService do expect(Gitlab::AppLogger).to have_received(:error).with(a_string_matching(error_message)) end - it 'logs and saves error if there is a squash in progress' do - error_message = 'another squash is already in progress' - - allow_any_instance_of(MergeRequest).to receive(:squash_in_progress?).and_return(true) - merge_request.update!(squash: true) - - service.execute(merge_request) - - expect(merge_request).to be_open - expect(merge_request.merge_commit_sha).to be_nil - expect(merge_request.squash_commit_sha).to be_nil - expect(merge_request.merge_error).to include(error_message) - expect(Gitlab::AppLogger).to have_received(:error).with(a_string_matching(error_message)) - end - it 'logs and saves error if there is an PreReceiveError exception' do error_message = 'error message' diff --git a/spec/services/merge_requests/squash_service_spec.rb b/spec/services/merge_requests/squash_service_spec.rb index 149748cdabc..09f83624e05 100644 --- a/spec/services/merge_requests/squash_service_spec.rb +++ b/spec/services/merge_requests/squash_service_spec.rb @@ -194,23 +194,6 @@ RSpec.describe MergeRequests::SquashService do expect(service.execute).to match(status: :error, message: a_string_including('squash')) end end - - context 'with an error in squash in progress check' do - before do - allow(repository).to receive(:squash_in_progress?) - .and_raise(Gitlab::Git::Repository::GitError, error) - end - - it 'logs the stage and output' do - expect(service).to receive(:log_error).with(exception: an_instance_of(Gitlab::Git::Repository::GitError), message: 'Failed to check squash in progress') - - service.execute - end - - it 'returns an error' do - expect(service.execute).to match(status: :error, message: 'An error occurred while checking whether another squash is in progress.') - end - end end context 'when any other exception is thrown' do |