diff options
author | James Lopez <james@jameslopez.es> | 2016-11-15 11:39:45 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-17 10:22:58 +0300 |
commit | 6a2737e6a82875311f71f451939b2732562533d4 (patch) | |
tree | 00ea2627d1103ba0c15375a570ff923b0296c790 /spec/serializers/analytics_generic_serializer_spec.rb | |
parent | 0ddf825ddf7bc480004919762b187390d0b900e9 (diff) |
WIP - refactor events to use a generic build entity for some of the hybrid events
Diffstat (limited to 'spec/serializers/analytics_generic_serializer_spec.rb')
-rw-r--r-- | spec/serializers/analytics_generic_serializer_spec.rb | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/spec/serializers/analytics_generic_serializer_spec.rb b/spec/serializers/analytics_generic_serializer_spec.rb index 24fd94810d4..4d523878015 100644 --- a/spec/serializers/analytics_generic_serializer_spec.rb +++ b/spec/serializers/analytics_generic_serializer_spec.rb @@ -1,15 +1,26 @@ require 'spec_helper' -describe AnalyticsBuildSerializer do +describe AnalyticsGenericSerializer do let(:serializer) do described_class .new(project: project) .represent(resource) end + let(:user) { create(:user) } let(:json) { serializer.as_json } let(:project) { create(:project) } - let(:resource) { create(:ci_build) } + let(:resource) { + { + total_time: "172802.724419", + title: "Eos voluptatem inventore in sed.", + iid: "1", + id: "1", + created_at: "2016-11-12 15:04:02.948604", + author: user, + entity: :merge_request + } + } context 'when there is a single object provided' do it 'it generates payload for single object' do @@ -17,8 +28,7 @@ describe AnalyticsBuildSerializer do end it 'contains important elements of analyticsBuild' do - expect(json) - .to include(:name, :branch, :short_sha, :date, :total_time, :url, :branch_url, :commit_url, :author) + expect(json).to include(:title, :iid, :date, :total_time, :url, :author) end end end |