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:
authorSean Edge <asedge@gmail.com>2014-09-25 06:30:06 +0400
committerSean Edge <asedge@gmail.com>2014-10-30 16:48:23 +0300
commit822d9aa6ba150ed1983dda3cfddaaa177f6b9f97 (patch)
treec476c8170a97f3d65ce89a268773a2289d2152e7 /spec/requests/api/repositories_spec.rb
parentf99b876837e8e86dc5f4d898c16046d3183804a8 (diff)
Create RepoTag Grape entity and present it when doing stuff with tags via API. Update API doc for repositories. Add tag message to tag list page in UI. Update Changelog. Update spec to set .gitconfig identity, required for annotated tags.
Diffstat (limited to 'spec/requests/api/repositories_spec.rb')
-rw-r--r--spec/requests/api/repositories_spec.rb33
1 files changed, 18 insertions, 15 deletions
diff --git a/spec/requests/api/repositories_spec.rb b/spec/requests/api/repositories_spec.rb
index 6e54839b677..dd7a0fc6cc8 100644
--- a/spec/requests/api/repositories_spec.rb
+++ b/spec/requests/api/repositories_spec.rb
@@ -34,21 +34,24 @@ describe API::API, api: true do
end
end
- # TODO: fix this test for CI
- #context 'annotated tag' do
- #it 'should create a new annotated tag' do
- #post api("/projects/#{project.id}/repository/tags", user),
- #tag_name: 'v7.1.0',
- #ref: 'master',
- #message: 'tag message'
-
- #response.status.should == 201
- #json_response['name'].should == 'v7.1.0'
- # The message is not part of the JSON response.
- # Additional changes to the gitlab_git gem may be required.
- # json_response['message'].should == 'tag message'
- #end
- #end
+ context 'annotated tag' do
+ it 'should create a new annotated tag' do
+ # Identity must be set in .gitconfig to create annotated tag.
+ repo_path = File.join(Gitlab.config.gitlab_shell.repos_path,
+ project.path_with_namespace + '.git')
+ system(*%W(git --git-dir=#{repo_path} config user.name #{user.name}))
+ system(*%W(git --git-dir=#{repo_path} config user.email #{user.email}))
+
+ post api("/projects/#{project.id}/repository/tags", user),
+ tag_name: 'v7.1.0',
+ ref: 'master',
+ message: 'Release 7.1.0'
+
+ response.status.should == 201
+ json_response['name'].should == 'v7.1.0'
+ json_response['message'].should == 'Release 7.1.0'
+ end
+ end
it 'should deny for user without push access' do
post api("/projects/#{project.id}/repository/tags", user2),