diff options
Diffstat (limited to 'spec/views/projects/ci/lints/show.html.haml_spec.rb')
-rw-r--r-- | spec/views/projects/ci/lints/show.html.haml_spec.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/views/projects/ci/lints/show.html.haml_spec.rb b/spec/views/projects/ci/lints/show.html.haml_spec.rb index bcfb952ca66..a71cea6d3c8 100644 --- a/spec/views/projects/ci/lints/show.html.haml_spec.rb +++ b/spec/views/projects/ci/lints/show.html.haml_spec.rb @@ -82,6 +82,20 @@ RSpec.describe 'projects/ci/lints/show' do expect(rendered).to have_content('Environment: testing') expect(rendered).to have_content('When: on_success') end + + context 'when content has warnings' do + before do + assign(:warnings, ['Warning 1', 'Warning 2']) + end + + it 'shows warning messages' do + render + + expect(rendered).to have_content('Warning:') + expect(rendered).to have_content('Warning 1') + expect(rendered).to have_content('Warning 2') + end + end end context 'when the content is invalid' do @@ -89,6 +103,7 @@ RSpec.describe 'projects/ci/lints/show' do assign(:project, project) assign(:status, false) assign(:errors, ['Undefined error']) + assign(:warnings, ['Warning 1', 'Warning 2']) end it 'shows error message' do @@ -98,5 +113,13 @@ RSpec.describe 'projects/ci/lints/show' do expect(rendered).to have_content('Undefined error') expect(rendered).not_to have_content('Tag list:') end + + it 'shows warning messages' do + render + + expect(rendered).to have_content('Warning:') + expect(rendered).to have_content('Warning 1') + expect(rendered).to have_content('Warning 2') + end end end |