2016-11-14 05:52:29 -05:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe AnalyticsBuildEntity do
|
|
|
|
let(:entity) do
|
|
|
|
described_class.new(build, request: double)
|
|
|
|
end
|
|
|
|
|
2016-11-15 03:39:45 -05:00
|
|
|
context 'build with an author' do
|
2016-11-14 08:53:06 -05:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
let(:build) { create(:ci_build, author: user) }
|
2016-11-14 05:52:29 -05:00
|
|
|
|
|
|
|
subject { entity.as_json }
|
|
|
|
|
2016-11-15 03:39:45 -05:00
|
|
|
it 'contains the URL' do
|
|
|
|
expect(subject).to include(:url)
|
2016-11-14 05:52:29 -05:00
|
|
|
end
|
|
|
|
|
2016-11-14 08:53:06 -05:00
|
|
|
it 'contains the author' do
|
|
|
|
expect(subject).to include(:author)
|
|
|
|
end
|
|
|
|
|
2016-11-14 05:52:29 -05:00
|
|
|
it 'does not contain sensitive information' do
|
|
|
|
expect(subject).not_to include(/token/)
|
|
|
|
expect(subject).not_to include(/variables/)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|