2016-11-14 12:05:13 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-11-18 02:13:34 -05:00
|
|
|
describe AnalyticsIssueSerializer do
|
2017-01-27 07:02:59 -05:00
|
|
|
subject do
|
2016-11-14 12:05:13 -05:00
|
|
|
described_class
|
2016-11-15 03:59:35 -05:00
|
|
|
.new(project: project, entity: :merge_request)
|
2016-11-14 12:05:13 -05:00
|
|
|
.represent(resource)
|
|
|
|
end
|
|
|
|
|
2016-11-15 03:39:45 -05:00
|
|
|
let(:user) { create(:user) }
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project) }
|
2016-11-16 06:01:10 -05:00
|
|
|
let(:resource) do
|
2016-11-15 03:39:45 -05:00
|
|
|
{
|
|
|
|
total_time: "172802.724419",
|
|
|
|
title: "Eos voluptatem inventore in sed.",
|
|
|
|
iid: "1",
|
|
|
|
id: "1",
|
|
|
|
created_at: "2016-11-12 15:04:02.948604",
|
2017-05-03 07:22:03 -04:00
|
|
|
author: user
|
2016-11-15 03:39:45 -05:00
|
|
|
}
|
2016-11-16 06:01:10 -05:00
|
|
|
end
|
2016-11-14 12:05:13 -05:00
|
|
|
|
|
|
|
context 'when there is a single object provided' do
|
2016-11-18 02:13:34 -05:00
|
|
|
it 'contains important elements of the issue' do
|
2017-01-27 07:02:59 -05:00
|
|
|
expect(subject).to include(:title, :iid, :created_at, :total_time, :url, :author)
|
2016-11-14 12:05:13 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|