Treat "" as nil for external commit status description

This commit is contained in:
Vladimir Shushlin 2019-01-22 15:14:29 +03:00
parent ffc9fe49a1
commit 7f6e0c84f8
2 changed files with 10 additions and 2 deletions

View file

@ -6,7 +6,7 @@ module Gitlab
module External
module Common
def label
subject.description || super
subject.description.presence || super
end
def has_details?

View file

@ -21,13 +21,21 @@ describe Gitlab::Ci::Status::External::Common do
expect(subject.label).to eq external_description
end
context 'when description is not set' do
context 'when description is nil' do
let(:external_description) { nil }
it 'uses core status label' do
expect(subject.label).to eq('passed')
end
end
context 'when description is empty string' do
let(:external_description) { '' }
it 'uses core status label' do
expect(subject.label).to eq('passed')
end
end
end
describe '#has_action?' do