diff options
author | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-03-05 21:23:49 +0100 |
---|---|---|
committer | Jeroen van Baarsen <jeroenvanbaarsen@gmail.com> | 2014-03-05 21:23:49 +0100 |
commit | 13d2bcc3b4d6141643fe31dc4d7212ebca0612a5 (patch) | |
tree | 5972611479cde53e840ad1a38e95b65d66785008 /spec | |
parent | 9a676ccc0a8dd26eb1ebd5042acbf31cfb906f91 (diff) | |
download | gitlab-ce-13d2bcc3b4d6141643fe31dc4d7212ebca0612a5.tar.gz |
Created a basic Git Tag Push service
This is the first version, and only has the most basic information about
the tag that is created.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/git_tag_push_service_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/services/git_tag_push_service_spec.rb b/spec/services/git_tag_push_service_spec.rb new file mode 100644 index 00000000000..aabb9f8f38d --- /dev/null +++ b/spec/services/git_tag_push_service_spec.rb @@ -0,0 +1,43 @@ +require 'spec_helper' + +describe GitTagPushService do + let (:user) { create :user } + let (:project) { create :project } + let (:service) { GitTagPushService.new } + + before do + @ref = 'refs/tags/super-tag' + end + + describe 'Git Tag Push Data' do + before do + service.execute(project, user, @ref) + @push_data = service.push_data + end + + subject { @push_data } + + it { should include(ref: @ref) } + it { should include(user_id: user.id) } + it { should include(user_name: user.name) } + it { should include(project_id: project.id) } + + context 'With repository data' do + subject { @push_data[:repository] } + + it { should include(name: project.name) } + it { should include(url: project.url_to_repo) } + it { should include(description: project.description) } + it { should include(homepage: project.web_url) } + end + end + + describe "Web Hooks" do + context "execute web hooks" do + it "when pushing tags" do + project.should_receive(:execute_hooks) + service.execute(project, user, 'refs/tags/v1.0.0') + end + end + end +end |