summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2016-04-18 21:52:43 -0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2016-04-19 11:00:30 +0200
commit5330af3fa69d4c47437ce27480c7f3b74652b2ca (patch)
treeebb871f468004a74cac5d737a231cf92defdf210 /spec
parent2384bed4d8e3f79461664911715e5f2a2a66c008 (diff)
downloadgitlab-ce-5330af3fa69d4c47437ce27480c7f3b74652b2ca.tar.gz
Using single builder for push and tag events
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/push_data_builder_spec.rb28
1 files changed, 6 insertions, 22 deletions
diff --git a/spec/lib/gitlab/push_data_builder_spec.rb b/spec/lib/gitlab/push_data_builder_spec.rb
index d6fb65e6948..7fc34139eff 100644
--- a/spec/lib/gitlab/push_data_builder_spec.rb
+++ b/spec/lib/gitlab/push_data_builder_spec.rb
@@ -34,6 +34,12 @@ describe Gitlab::PushDataBuilder, lib: true do
it { expect(data[:checkout_sha]).to eq('5937ac0a7beb003549fc5fd26fc247adbce4a52e') }
it { expect(data[:after]).to eq('8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b') }
it { expect(data[:ref]).to eq('refs/tags/v1.1.0') }
+ it { expect(data[:user_id]).to eq(user.id) }
+ it { expect(data[:user_name]).to eq(user.name) }
+ it { expect(data[:user_email]).to eq(user.email) }
+ it { expect(data[:user_avatar]).to eq(user.avatar_url) }
+ it { expect(data[:project_id]).to eq(project.id) }
+ it { expect(data[:project]).to be_a(Hash) }
it { expect(data[:commits]).to be_empty }
it { expect(data[:total_commits_count]).to be_zero }
@@ -45,26 +51,4 @@ describe Gitlab::PushDataBuilder, lib: true do
not_to raise_error
end
end
-
- describe '.build_system' do
- let(:data) do
- described_class.build_system(project, user, Gitlab::Git::BLANK_SHA,
- '8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b',
- 'refs/tags/v1.1.0')
- end
-
- it { expect(data).to be_a(Hash) }
- it { expect(data[:before]).to eq(Gitlab::Git::BLANK_SHA) }
- it { expect(data[:checkout_sha]).to eq('5937ac0a7beb003549fc5fd26fc247adbce4a52e') }
- it { expect(data[:after]).to eq('8a2a6eb295bb170b34c24c76c49ed0e9b2eaf34b') }
- it { expect(data[:ref]).to eq('refs/tags/v1.1.0') }
- it { expect(data[:user_id]).to eq(user.id) }
- it { expect(data[:user_name]).to eq(user.name) }
- it { expect(data[:user_email]).to eq(user.email) }
- it { expect(data[:user_avatar]).to eq(user.avatar_url) }
- it { expect(data[:project_id]).to eq(project.id) }
- it { expect(data[:project]).to be_a(Hash) }
-
- include_examples 'project hook data'
- end
end