Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-08-06 06:10:05 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-08-06 06:10:05 +0300
commitabf508470ef1e667bcfa42c4e9b825bcce06e60c (patch)
tree3217a7d18df4c8da15e5f1d078f967c736ba6f20 /spec/services/branches
parent631ed6dcca9d41d0dc24dd553065de1a0f8210f0 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/branches')
-rw-r--r--spec/services/branches/create_service_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/services/branches/create_service_spec.rb b/spec/services/branches/create_service_spec.rb
index b682a3f26ec..5cf0d5af75f 100644
--- a/spec/services/branches/create_service_spec.rb
+++ b/spec/services/branches/create_service_spec.rb
@@ -44,5 +44,25 @@ RSpec.describe Branches::CreateService do
expect(result[:message]).to eq('Invalid reference name: unknown')
end
end
+
+ it 'logs and returns an error if there is a PreReceiveError exception' do
+ error_message = 'pre receive error'
+ raw_message = "GitLab: #{error_message}"
+ pre_receive_error = Gitlab::Git::PreReceiveError.new(raw_message)
+
+ allow(project.repository).to receive(:add_branch).and_raise(pre_receive_error)
+
+ expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
+ pre_receive_error,
+ pre_receive_message: raw_message,
+ branch_name: 'new-feature',
+ ref: 'unknown'
+ )
+
+ result = service.execute('new-feature', 'unknown')
+
+ expect(result[:status]).to eq(:error)
+ expect(result[:message]).to eq(error_message)
+ end
end
end