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:
Diffstat (limited to 'spec/services/tags/create_service_spec.rb')
-rw-r--r--spec/services/tags/create_service_spec.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/services/tags/create_service_spec.rb b/spec/services/tags/create_service_spec.rb
index b1c6623308e..bbf6fe62959 100644
--- a/spec/services/tags/create_service_spec.rb
+++ b/spec/services/tags/create_service_spec.rb
@@ -27,6 +27,26 @@ RSpec.describe Tags::CreateService do
end
end
+ context 'when tag_name is empty' do
+ it 'returns an error' do
+ response = service.execute('', 'foo', 'Foo')
+
+ expect(response[:status]).to eq(:error)
+ expect(response[:http_status]).to eq(400)
+ expect(response[:message]).to eq('Tag name invalid')
+ end
+ end
+
+ context 'when target is empty' do
+ it 'returns an error' do
+ response = service.execute('v1.1.0', '', 'Foo')
+
+ expect(response[:status]).to eq(:error)
+ expect(response[:http_status]).to eq(400)
+ expect(response[:message]).to eq('Target is empty')
+ end
+ end
+
context 'when tag already exists' do
it 'returns an error' do
expect(repository).to receive(:add_tag)