diff options
author | Sean Edge <asedge@gmail.com> | 2014-09-24 22:30:06 -0400 |
---|---|---|
committer | Sean Edge <asedge@gmail.com> | 2014-10-30 09:48:23 -0400 |
commit | 822d9aa6ba150ed1983dda3cfddaaa177f6b9f97 (patch) | |
tree | c476c8170a97f3d65ce89a268773a2289d2152e7 /spec/requests/api/repositories_spec.rb | |
parent | f99b876837e8e86dc5f4d898c16046d3183804a8 (diff) | |
download | gitlab-ce-822d9aa6ba150ed1983dda3cfddaaa177f6b9f97.tar.gz |
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.rb | 33 |
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), |