2016-11-14 12:05:13 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-11-17 07:22:27 -05:00
|
|
|
describe AnalyticsIssueEntity do
|
2016-11-14 12:05:13 -05:00
|
|
|
let(:user) { create(:user) }
|
2016-11-16 06:01:10 -05:00
|
|
|
let(:entity_hash) do
|
2016-11-14 12:05:13 -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-14 12:05:13 -05:00
|
|
|
}
|
2016-11-16 06:01:10 -05:00
|
|
|
end
|
2016-11-14 12:05:13 -05:00
|
|
|
|
2017-08-02 15:55:11 -04:00
|
|
|
let(:project) { create(:project) }
|
2016-11-15 03:59:35 -05:00
|
|
|
let(:request) { EntityRequest.new(project: project, entity: :merge_request) }
|
2016-11-14 12:05:13 -05:00
|
|
|
|
|
|
|
let(:entity) do
|
2016-11-15 03:59:35 -05:00
|
|
|
described_class.new(entity_hash, request: request, project: project)
|
2016-11-14 12:05:13 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'generic entity' do
|
|
|
|
subject { entity.as_json }
|
|
|
|
|
|
|
|
it 'contains the entity URL' do
|
|
|
|
expect(subject).to include(:url)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'contains the author' do
|
|
|
|
expect(subject).to include(:author)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'does not contain sensitive information' do
|
|
|
|
expect(subject).not_to include(/token/)
|
|
|
|
expect(subject).not_to include(/variables/)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|