Commit 552f8032 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Merge branch '40997-gitlab-pages-deploy-jobs-have-a-null-status' into 'master'

Fix empty labels for `pages:deploy` job

Closes #40997

See merge request gitlab-org/gitlab-ce!24451
parents ca52a125 7f6e0c84
---
title: Fix empty labels of CI builds for gitlab-pages on pipeline page
merge_request: 24451
author:
type: fixed
......@@ -6,7 +6,7 @@ module Gitlab
module External
module Common
def label
subject.description
subject.description.presence || super
end
def has_details?
......
......@@ -11,7 +11,7 @@ describe Gitlab::Ci::Status::External::Common do
end
subject do
Gitlab::Ci::Status::Core
Gitlab::Ci::Status::Success
.new(external_status, user)
.extend(described_class)
end
......@@ -20,6 +20,22 @@ describe Gitlab::Ci::Status::External::Common do
it 'returns description' do
expect(subject.label).to eq external_description
end
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
......
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