Treat "" as nil for external commit status description
This commit is contained in:
parent
ffc9fe49a1
commit
7f6e0c84f8
2 changed files with 10 additions and 2 deletions
2
lib/gitlab/ci/status/external/common.rb
vendored
2
lib/gitlab/ci/status/external/common.rb
vendored
|
@ -6,7 +6,7 @@ module Gitlab
|
|||
module External
|
||||
module Common
|
||||
def label
|
||||
subject.description || super
|
||||
subject.description.presence || super
|
||||
end
|
||||
|
||||
def has_details?
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue