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:
authortiagonbotelho <tiagonbotelho@hotmail.com>2016-08-01 18:00:44 +0300
committertiagonbotelho <tiagonbotelho@hotmail.com>2016-08-09 17:11:39 +0300
commit1d268a89deef10854193db48d65cf5d519a0363d (patch)
tree59765b4a2f83b453875fa7aefe9b7ab5c65e3c67 /spec/requests/api/tags_spec.rb
parent519275c1102ad8a1d56f5807de2d8a1ae4b21dc0 (diff)
adds second batch of tests changed to active tense
Diffstat (limited to 'spec/requests/api/tags_spec.rb')
-rw-r--r--spec/requests/api/tags_spec.rb34
1 files changed, 17 insertions, 17 deletions
diff --git a/spec/requests/api/tags_spec.rb b/spec/requests/api/tags_spec.rb
index fa700ab7343..d563883cd47 100644
--- a/spec/requests/api/tags_spec.rb
+++ b/spec/requests/api/tags_spec.rb
@@ -16,7 +16,7 @@ describe API::API, api: true do
let(:description) { 'Awesome release!' }
context 'without releases' do
- it "should return an array of project tags" do
+ it "returns an array of project tags" do
get api("/projects/#{project.id}/repository/tags", user)
expect(response).to have_http_status(200)
expect(json_response).to be_an Array
@@ -30,7 +30,7 @@ describe API::API, api: true do
release.update_attributes(description: description)
end
- it "should return an array of project tags with release info" do
+ it "returns an array of project tags with release info" do
get api("/projects/#{project.id}/repository/tags", user)
expect(response).to have_http_status(200)
@@ -61,7 +61,7 @@ describe API::API, api: true do
describe 'POST /projects/:id/repository/tags' do
context 'lightweight tags' do
- it 'should create a new tag' do
+ it 'creates a new tag' do
post api("/projects/#{project.id}/repository/tags", user),
tag_name: 'v7.0.1',
ref: 'master'
@@ -72,7 +72,7 @@ describe API::API, api: true do
end
context 'lightweight tags with release notes' do
- it 'should create a new tag' do
+ it 'creates a new tag' do
post api("/projects/#{project.id}/repository/tags", user),
tag_name: 'v7.0.1',
ref: 'master',
@@ -92,13 +92,13 @@ describe API::API, api: true do
end
context 'delete tag' do
- it 'should delete an existing tag' do
+ it 'deletes an existing tag' do
delete api("/projects/#{project.id}/repository/tags/#{tag_name}", user)
expect(response).to have_http_status(200)
expect(json_response['tag_name']).to eq(tag_name)
end
- it 'should raise 404 if the tag does not exist' do
+ it 'raises 404 if the tag does not exist' do
delete api("/projects/#{project.id}/repository/tags/foobar", user)
expect(response).to have_http_status(404)
end
@@ -106,7 +106,7 @@ describe API::API, api: true do
end
context 'annotated tag' do
- it 'should create a new annotated tag' do
+ it 'creates a new annotated tag' do
# Identity must be set in .gitconfig to create annotated tag.
repo_path = project.repository.path_to_repo
system(*%W(#{Gitlab.config.git.bin_path} --git-dir=#{repo_path} config user.name #{user.name}))
@@ -123,14 +123,14 @@ describe API::API, api: true do
end
end
- it 'should deny for user without push access' do
+ it 'denies for user without push access' do
post api("/projects/#{project.id}/repository/tags", user2),
tag_name: 'v1.9.0',
ref: '621491c677087aa243f165eab467bfdfbee00be1'
expect(response).to have_http_status(403)
end
- it 'should return 400 if tag name is invalid' do
+ it 'returns 400 if tag name is invalid' do
post api("/projects/#{project.id}/repository/tags", user),
tag_name: 'v 1.0.0',
ref: 'master'
@@ -138,7 +138,7 @@ describe API::API, api: true do
expect(json_response['message']).to eq('Tag name invalid')
end
- it 'should return 400 if tag already exists' do
+ it 'returns 400 if tag already exists' do
post api("/projects/#{project.id}/repository/tags", user),
tag_name: 'v8.0.0',
ref: 'master'
@@ -150,7 +150,7 @@ describe API::API, api: true do
expect(json_response['message']).to eq('Tag v8.0.0 already exists')
end
- it 'should return 400 if ref name is invalid' do
+ it 'returns 400 if ref name is invalid' do
post api("/projects/#{project.id}/repository/tags", user),
tag_name: 'mytag',
ref: 'foo'
@@ -163,7 +163,7 @@ describe API::API, api: true do
let(:tag_name) { project.repository.tag_names.first }
let(:description) { 'Awesome release!' }
- it 'should create description for existing git tag' do
+ it 'creates description for existing git tag' do
post api("/projects/#{project.id}/repository/tags/#{tag_name}/release", user),
description: description
@@ -172,7 +172,7 @@ describe API::API, api: true do
expect(json_response['description']).to eq(description)
end
- it 'should return 404 if the tag does not exist' do
+ it 'returns 404 if the tag does not exist' do
post api("/projects/#{project.id}/repository/tags/foobar/release", user),
description: description
@@ -186,7 +186,7 @@ describe API::API, api: true do
release.update_attributes(description: description)
end
- it 'should return 409 if there is already a release' do
+ it 'returns 409 if there is already a release' do
post api("/projects/#{project.id}/repository/tags/#{tag_name}/release", user),
description: description
@@ -207,7 +207,7 @@ describe API::API, api: true do
release.update_attributes(description: description)
end
- it 'should update the release description' do
+ it 'updates the release description' do
put api("/projects/#{project.id}/repository/tags/#{tag_name}/release", user),
description: new_description
@@ -217,7 +217,7 @@ describe API::API, api: true do
end
end
- it 'should return 404 if the tag does not exist' do
+ it 'returns 404 if the tag does not exist' do
put api("/projects/#{project.id}/repository/tags/foobar/release", user),
description: new_description
@@ -225,7 +225,7 @@ describe API::API, api: true do
expect(json_response['message']).to eq('Tag does not exist')
end
- it 'should return 404 if the release does not exist' do
+ it 'returns 404 if the release does not exist' do
put api("/projects/#{project.id}/repository/tags/#{tag_name}/release", user),
description: new_description