2019-07-25 01:21:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-28 08:58:32 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 14:09:03 -04:00
|
|
|
RSpec.describe Gitlab::Ci::Status::Build::Pending do
|
2018-03-29 13:39:30 -04:00
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
2018-03-28 08:58:32 -04:00
|
|
|
subject do
|
|
|
|
described_class.new(double('subject'))
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#illustration' do
|
|
|
|
it { expect(subject.illustration).to include(:image, :size, :title, :content) }
|
|
|
|
end
|
2018-03-29 13:39:30 -04:00
|
|
|
|
|
|
|
describe '.matches?' do
|
|
|
|
subject {described_class.matches?(build, user) }
|
|
|
|
|
|
|
|
context 'when build is pending' do
|
|
|
|
let(:build) { create(:ci_build, :pending) }
|
|
|
|
|
|
|
|
it 'is a correct match' do
|
|
|
|
expect(subject).to be true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when build is not pending' do
|
|
|
|
let(:build) { create(:ci_build, :success) }
|
|
|
|
|
|
|
|
it 'does not match' do
|
|
|
|
expect(subject).to be false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2018-03-28 08:58:32 -04:00
|
|
|
end
|