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:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 15:07:33 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 15:07:33 +0300
commit6b75320f525f841454f1ab162d141d3610f2e77b (patch)
tree4971c27759e4fbc18b85e71800c3b9c12346317e /spec/services/bulk_push_event_payload_service_spec.rb
parent4226aca420920c1844e8eade4798a2dff188a6fc (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/bulk_push_event_payload_service_spec.rb')
-rw-r--r--spec/services/bulk_push_event_payload_service_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/services/bulk_push_event_payload_service_spec.rb b/spec/services/bulk_push_event_payload_service_spec.rb
new file mode 100644
index 00000000000..661c3540aa0
--- /dev/null
+++ b/spec/services/bulk_push_event_payload_service_spec.rb
@@ -0,0 +1,27 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe BulkPushEventPayloadService do
+ let(:event) { create(:push_event) }
+
+ let(:push_data) do
+ {
+ action: :created,
+ ref_count: 4,
+ ref_type: :branch
+ }
+ end
+
+ subject { described_class.new(event, push_data) }
+
+ it 'creates a PushEventPayload' do
+ push_event_payload = subject.execute
+
+ expect(push_event_payload).to be_persisted
+ expect(push_event_payload.action).to eq(push_data[:action].to_s)
+ expect(push_event_payload.commit_count).to eq(0)
+ expect(push_event_payload.ref_count).to eq(push_data[:ref_count])
+ expect(push_event_payload.ref_type).to eq(push_data[:ref_type].to_s)
+ end
+end