summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-10 15:09:50 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-10 15:09:50 +0000
commitde2fb5b82c92c90f90ed67ced45143c04e934fb8 (patch)
treeff8e5e642580de7bb596d90dd0e7f739f44ca540 /spec/services
parentc6a33b298229f9e04933be43d6176c476ef03012 (diff)
downloadgitlab-ce-de2fb5b82c92c90f90ed67ced45143c04e934fb8.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/tags/create_service_spec.rb24
1 files changed, 18 insertions, 6 deletions
diff --git a/spec/services/tags/create_service_spec.rb b/spec/services/tags/create_service_spec.rb
index ee558f90d6f..e505960d3c7 100644
--- a/spec/services/tags/create_service_spec.rb
+++ b/spec/services/tags/create_service_spec.rb
@@ -21,8 +21,9 @@ describe Tags::CreateService do
it 'returns an error' do
response = service.execute('v1.1.0', 'foo', 'Foo')
- expect(response).to eq(status: :error,
- message: 'Target foo is invalid')
+ expect(response[:status]).to eq(:error)
+ expect(response[:http_status]).to eq(400)
+ expect(response[:message]).to eq('Target foo is invalid')
end
end
@@ -34,8 +35,19 @@ describe Tags::CreateService do
response = service.execute('v1.1.0', 'master', 'Foo')
- expect(response).to eq(status: :error,
- message: 'Tag v1.1.0 already exists')
+ expect(response[:status]).to eq(:error)
+ expect(response[:http_status]).to eq(409)
+ expect(response[:message]).to eq('Tag v1.1.0 already exists')
+ end
+ end
+
+ context 'when tag name is invalid' do
+ it 'returns an error' do
+ response = service.execute('HEAD', 'master', 'Foo')
+
+ expect(response[:status]).to eq(:error)
+ expect(response[:http_status]).to eq(400)
+ expect(response[:message]).to eq('Tag name invalid')
end
end
@@ -47,8 +59,8 @@ describe Tags::CreateService do
response = service.execute('v1.1.0', 'master', 'Foo')
- expect(response).to eq(status: :error,
- message: 'something went wrong')
+ expect(response[:status]).to eq(:error)
+ expect(response[:message]).to eq('something went wrong')
end
end
end