diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-10 18:09:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-10 18:09:50 +0300 |
commit | de2fb5b82c92c90f90ed67ced45143c04e934fb8 (patch) | |
tree | ff8e5e642580de7bb596d90dd0e7f739f44ca540 /spec/services/tags | |
parent | c6a33b298229f9e04933be43d6176c476ef03012 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/tags')
-rw-r--r-- | spec/services/tags/create_service_spec.rb | 24 |
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 |