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>2019-11-14 06:06:25 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-14 06:06:25 +0300
commit29c01c6c91558358c37ba45b03f240632bfb918d (patch)
treec6475afaf98ce740e8ba5fe227e7bd4a95b692cd /spec/requests/api/commits_spec.rb
parenteed996ac33a60d5fd8315a62fec8beaa8e907e69 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/requests/api/commits_spec.rb')
-rw-r--r--spec/requests/api/commits_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/requests/api/commits_spec.rb b/spec/requests/api/commits_spec.rb
index 9cea4866c4c..d8da1c001b0 100644
--- a/spec/requests/api/commits_spec.rb
+++ b/spec/requests/api/commits_spec.rb
@@ -1376,6 +1376,12 @@ describe API::Commits do
it_behaves_like '400 response' do
let(:request) { post api(route, current_user), params: { branch: 'markdown' } }
end
+
+ it 'includes an error_code in the response' do
+ post api(route, current_user), params: { branch: 'markdown' }
+
+ expect(json_response['error_code']).to eq 'empty'
+ end
end
context 'when ref contains a dot' do
@@ -1535,6 +1541,19 @@ describe API::Commits do
let(:request) { post api(route, current_user) }
end
end
+
+ context 'when commit is already reverted in the target branch' do
+ it 'includes an error_code in the response' do
+ # First one actually reverts
+ post api(route, current_user), params: { branch: 'markdown' }
+
+ # Second one is redundant and should be empty
+ post api(route, current_user), params: { branch: 'markdown' }
+
+ expect(response).to have_gitlab_http_status(400)
+ expect(json_response['error_code']).to eq 'empty'
+ end
+ end
end
context 'when authenticated', 'as a developer' do