Commit 00b45348 authored by Matija Čupić's avatar Matija Čupić

Fix job setup in success empty state specs

parent d883fe1c
......@@ -12,7 +12,7 @@ module Gitlab
end
def self.matches?(build, user)
build.success?
!build.has_trace? && build.success?
end
end
end
......
......@@ -13,7 +13,7 @@ describe Gitlab::Ci::Status::Build::Factory do
end
context 'when build is successful' do
let(:build) { create(:ci_build, :success) }
let(:build) { create(:ci_build, :success, :trace_artifact) }
it 'matches correct core status' do
expect(factory.core_status).to be_a Gitlab::Ci::Status::Success
......@@ -39,7 +39,7 @@ describe Gitlab::Ci::Status::Build::Factory do
context 'when job log gets erased' do
before do
build.trace.set(nil)
build.erase
end
it 'matches correct extended statuses' do
......
......@@ -12,18 +12,20 @@ describe Gitlab::Ci::Status::Build::Success do
end
describe '.matches?' do
subject {described_class.matches?(build, user) }
subject { described_class.matches?(build, user) }
context 'when build succeeded' do
context 'when build succeeded but does not have trace' do
let(:build) { create(:ci_build, :success) }
it 'is a correct match' do
build.erase
expect(subject).to be true
end
end
context 'when build did not succeed' do
let(:build) { create(:ci_build, :skipped) }
context 'when build succeed but has trace' do
let!(:build) { create(:ci_build, :success, :trace_artifact) }
it 'does not match' do
expect(subject).to be false
......
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