diff options
Diffstat (limited to 'spec/helpers/ci/pipelines_helper_spec.rb')
-rw-r--r-- | spec/helpers/ci/pipelines_helper_spec.rb | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/spec/helpers/ci/pipelines_helper_spec.rb b/spec/helpers/ci/pipelines_helper_spec.rb index 89b9907d0c2..a96d6e7711f 100644 --- a/spec/helpers/ci/pipelines_helper_spec.rb +++ b/spec/helpers/ci/pipelines_helper_spec.rb @@ -22,8 +22,8 @@ RSpec.describe Ci::PipelinesHelper do let(:warning_messages) { [double(content: 'Warning 1'), double(content: 'Warning 2')] } it 'returns a warning callout box' do - expect(subject).to have_css 'div.alert-warning' - expect(subject).to include 'Warning:' + expect(subject).to have_css 'div.bs-callout-warning' + expect(subject).to include '2 warning(s) found:' end it 'lists the the warnings' do @@ -32,4 +32,24 @@ RSpec.describe Ci::PipelinesHelper do end end end + + describe 'warning_header' do + subject { helper.warning_header(count) } + + context 'when warnings are more than max cap' do + let(:count) { 30 } + + it 'returns 30 warning(s) found: showing first 25' do + expect(subject).to eq('30 warning(s) found: showing first 25') + end + end + + context 'when warnings are less than max cap' do + let(:count) { 15 } + + it 'returns 15 warning(s) found' do + expect(subject).to eq('15 warning(s) found:') + end + end + end end |