gitlab-org--gitlab-foss/spec/serializers/analytics_merge_request_serializer_spec.rb

30 lines
726 B
Ruby
Raw Normal View History

require 'spec_helper'
2016-11-18 02:13:34 -05:00
describe AnalyticsMergeRequestSerializer do
subject do
described_class
.new(project: project, entity: :merge_request)
.represent(resource)
end
let(:user) { create(:user) }
let(:project) { create(:project) }
let(:resource) do
{
total_time: "172802.724419",
title: "Eos voluptatem inventore in sed.",
iid: "1",
id: "1",
2016-11-18 02:13:34 -05:00
state: 'open',
created_at: "2016-11-12 15:04:02.948604",
2016-11-18 02:13:34 -05:00
author: user
}
end
context 'when there is a single object provided' do
2016-11-18 02:13:34 -05:00
it 'contains important elements of the merge request' do
expect(subject).to include(:title, :iid, :created_at, :total_time, :url, :author, :state)
end
end
end