2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-05-09 12:01:36 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Ci::Status::Build::Created do
|
2018-05-09 12:01:36 +05:30
|
|
|
let(:user) { create(:user) }
|
|
|
|
|
|
|
|
subject do
|
|
|
|
described_class.new(double('subject'))
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '#illustration' do
|
|
|
|
it { expect(subject.illustration).to include(:image, :size, :title, :content) }
|
|
|
|
end
|
|
|
|
|
|
|
|
describe '.matches?' do
|
2022-08-27 11:52:29 +05:30
|
|
|
subject { described_class.matches?(build, user) }
|
2018-05-09 12:01:36 +05:30
|
|
|
|
|
|
|
context 'when build is created' do
|
|
|
|
let(:build) { create(:ci_build, :created) }
|
|
|
|
|
|
|
|
it 'is a correct match' do
|
|
|
|
expect(subject).to be true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when build is not created' do
|
|
|
|
let(:build) { create(:ci_build) }
|
|
|
|
|
|
|
|
it 'does not match' do
|
|
|
|
expect(subject).to be false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|