2016-12-21 13:47:20 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-12-21 13:51:53 +00:00
|
|
|
describe BuildArtifactEntity do
|
2017-05-16 11:41:15 +00:00
|
|
|
let(:job) { create(:ci_build, name: 'test:job') }
|
2016-12-21 13:47:20 +00:00
|
|
|
|
|
|
|
let(:entity) do
|
2017-05-16 11:41:15 +00:00
|
|
|
described_class.new(job, request: double)
|
2016-12-21 13:47:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
describe '#as_json' do
|
|
|
|
subject { entity.as_json }
|
|
|
|
|
2017-05-16 11:41:15 +00:00
|
|
|
it 'contains job name' do
|
|
|
|
expect(subject[:name]).to eq 'test:job'
|
2016-12-21 13:47:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it 'contains path to the artifacts' do
|
|
|
|
expect(subject[:path])
|
2017-05-16 11:41:15 +00:00
|
|
|
.to include "jobs/#{job.id}/artifacts/download"
|
2016-12-21 13:47:20 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|