Commit 7f6e0c84 authored by Vladimir Shushlin's avatar Vladimir Shushlin

Treat "" as nil for external commit status description

parent ffc9fe49
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
module External module External
module Common module Common
def label def label
subject.description || super subject.description.presence || super
end end
def has_details? def has_details?
......
...@@ -21,13 +21,21 @@ describe Gitlab::Ci::Status::External::Common do ...@@ -21,13 +21,21 @@ describe Gitlab::Ci::Status::External::Common do
expect(subject.label).to eq external_description expect(subject.label).to eq external_description
end end
context 'when description is not set' do context 'when description is nil' do
let(:external_description) { nil } let(:external_description) { nil }
it 'uses core status label' do it 'uses core status label' do
expect(subject.label).to eq('passed') expect(subject.label).to eq('passed')
end end
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 end
describe '#has_action?' do describe '#has_action?' do
......
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