diff options
author | James Lopez <james@jameslopez.es> | 2016-11-18 10:13:34 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-11-18 10:13:34 +0300 |
commit | e56c305be003ee33b093f9ba42622fba0da903f2 (patch) | |
tree | 03165847694615ccdd2709a6f07d8032ba7f2bbd /spec/serializers/analytics_issue_serializer_spec.rb | |
parent | 24c2aa39ad0f55321ef2c28ce10d740bf6b78980 (diff) |
fix spec failures
Diffstat (limited to 'spec/serializers/analytics_issue_serializer_spec.rb')
-rw-r--r-- | spec/serializers/analytics_issue_serializer_spec.rb | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/spec/serializers/analytics_issue_serializer_spec.rb b/spec/serializers/analytics_issue_serializer_spec.rb new file mode 100644 index 00000000000..2842e1ba52f --- /dev/null +++ b/spec/serializers/analytics_issue_serializer_spec.rb @@ -0,0 +1,33 @@ +require 'spec_helper' + +describe AnalyticsIssueSerializer do + let(:serializer) do + described_class + .new(project: project, entity: :merge_request) + .represent(resource) + end + + let(:user) { create(:user) } + let(:json) { serializer.as_json } + let(:project) { create(:project) } + let(:resource) do + { + 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, + } + end + + context 'when there is a single object provided' do + it 'it generates payload for single object' do + expect(json).to be_an_instance_of Hash + end + + it 'contains important elements of the issue' do + expect(json).to include(:title, :iid, :created_at, :total_time, :url, :author) + end + end +end |