diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-24 15:10:17 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-24 15:10:17 +0300 |
commit | 4b9bde7848d9538c1635ffe7a5385ba013487b4a (patch) | |
tree | 5aad1d5d94ea233a36c8ac2850e099236e1c2cdc /spec/lib/gitlab/badge | |
parent | 2f752481c2e727834216a93dee82df9f8e2acb2e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/badge')
-rw-r--r-- | spec/lib/gitlab/badge/pipeline/status_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/lib/gitlab/badge/pipeline/status_spec.rb b/spec/lib/gitlab/badge/pipeline/status_spec.rb index fcc0d4030fd..b5dabca0477 100644 --- a/spec/lib/gitlab/badge/pipeline/status_spec.rb +++ b/spec/lib/gitlab/badge/pipeline/status_spec.rb @@ -78,6 +78,34 @@ RSpec.describe Gitlab::Badge::Pipeline::Status do expect(badge.status).to eq 'success' end end + + context 'when ignored_skipped is set to true' do + let(:new_badge) { described_class.new(project, branch, opts: { ignore_skipped: true }) } + + before do + pipeline.skip! + end + + describe '#status' do + it 'uses latest non-skipped status' do + expect(new_badge.status).not_to eq 'skipped' + end + end + end + + context 'when ignored_skipped is set to false' do + let(:new_badge) { described_class.new(project, branch, opts: { ignore_skipped: false }) } + + before do + pipeline.skip! + end + + describe '#status' do + it 'uses latest status' do + expect(new_badge.status).to eq 'skipped' + end + end + end end context 'build does not exist' do |