From 74f13e0ddf1d7adb14fd4df9dd95519498157013 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Sat, 11 Mar 2017 19:56:05 +0900 Subject: [PATCH] Fix unchanged structure. Add favicon for 'failed_allowed' and 'success_warning' because it'll be used. --- lib/gitlab/ci/status/build/failed_allowed.rb | 4 ++++ lib/gitlab/ci/status/success_warning.rb | 4 ++++ spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb | 6 ++++++ spec/lib/gitlab/ci/status/success_warning_spec.rb | 4 ++++ spec/serializers/build_entity_spec.rb | 4 ++-- 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/gitlab/ci/status/build/failed_allowed.rb b/lib/gitlab/ci/status/build/failed_allowed.rb index 807afe24bd5..8693bd5849f 100644 --- a/lib/gitlab/ci/status/build/failed_allowed.rb +++ b/lib/gitlab/ci/status/build/failed_allowed.rb @@ -13,6 +13,10 @@ module Gitlab 'icon_status_warning' end + def favicon + 'favicon_status_warning' + end + def group 'failed_with_warnings' end diff --git a/lib/gitlab/ci/status/success_warning.rb b/lib/gitlab/ci/status/success_warning.rb index d4cdab6957a..9b735ed235a 100644 --- a/lib/gitlab/ci/status/success_warning.rb +++ b/lib/gitlab/ci/status/success_warning.rb @@ -20,6 +20,10 @@ module Gitlab 'icon_status_warning' end + def favicon + 'favicon_status_warning' + end + def group 'success_with_warnings' end diff --git a/spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb b/spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb index 20f71459738..b39ccbb1f60 100644 --- a/spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb +++ b/spec/lib/gitlab/ci/status/build/failed_allowed_spec.rb @@ -22,6 +22,12 @@ describe Gitlab::Ci::Status::Build::FailedAllowed do end end + describe '#favicon' do + it 'returns a warning favicon' do + expect(subject.favicon).to eq 'favicon_status_warning' + end + end + describe '#label' do it 'returns information about failed but allowed to fail status' do expect(subject.label).to eq 'failed (allowed to fail)' diff --git a/spec/lib/gitlab/ci/status/success_warning_spec.rb b/spec/lib/gitlab/ci/status/success_warning_spec.rb index 7e2269397c6..19d0da499f9 100644 --- a/spec/lib/gitlab/ci/status/success_warning_spec.rb +++ b/spec/lib/gitlab/ci/status/success_warning_spec.rb @@ -17,6 +17,10 @@ describe Gitlab::Ci::Status::SuccessWarning do it { expect(subject.icon).to eq 'icon_status_warning' } end + describe '#favicon' do + it { expect(subject.favicon).to eq 'favicon_status_warning' } + end + describe '#group' do it { expect(subject.group).to eq 'success_with_warnings' } end diff --git a/spec/serializers/build_entity_spec.rb b/spec/serializers/build_entity_spec.rb index cd30b00c711..7dcdf54fd93 100644 --- a/spec/serializers/build_entity_spec.rb +++ b/spec/serializers/build_entity_spec.rb @@ -29,8 +29,8 @@ describe BuildEntity do end it 'contains details' do - expect(subject).to include :details - expect(subject[:details][:status]).to include :icon, :favicon, :text, :label + expect(subject).to include :status + expect(subject[:status]).to include :icon, :favicon, :text, :label end context 'when build is a regular job' do