Commit a68e7e60 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Add basic tests for build entity used by serialzier

parent 6c94adea
require 'spec_helper'
describe BuildEntity do
subject do
described_class.new(build, request: double).as_json
end
context 'when build is a regular job' do
let(:build) { create(:ci_build) }
it 'contains url to build page and retry action' do
expect(subject).to include(:build_url, :retry_url)
expect(subject).not_to include(:play_url)
end
end
context 'when build is a manual action' do
let(:build) { create(:ci_build, :manual) }
it 'contains url to play action' do
expect(subject).to include(:play_url)
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment