Add test for linter values visibility
This commit is contained in:
parent
375072aa27
commit
b13502ef82
2 changed files with 34 additions and 1 deletions
|
@ -21,7 +21,7 @@
|
|||
|
||||
%br
|
||||
%b Tag list:
|
||||
= build[:tag_list]
|
||||
= build[:tag_list] && build[:tag_list].join(", ")
|
||||
%br
|
||||
%b Refs only:
|
||||
= build[:only] && build[:only].join(", ")
|
||||
|
|
33
spec/views/ci/lints/show.html.haml_spec.rb
Normal file
33
spec/views/ci/lints/show.html.haml_spec.rb
Normal file
|
@ -0,0 +1,33 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'ci/lints/show' do
|
||||
let(:content) do
|
||||
{ build_template: {
|
||||
script: './build.sh',
|
||||
tags: ['dotnet'],
|
||||
only: ['test@dude/repo'],
|
||||
except: ['deploy'],
|
||||
environment: 'testing'
|
||||
}
|
||||
}
|
||||
end
|
||||
let(:config_processor) { Ci::GitlabCiYamlProcessor.new(YAML.dump(content)) }
|
||||
|
||||
context 'when content is valid' do
|
||||
before do
|
||||
assign(:status, true)
|
||||
assign(:builds, config_processor.builds)
|
||||
assign(:stages, config_processor.stages)
|
||||
end
|
||||
|
||||
it 'shows correct values' do
|
||||
render
|
||||
|
||||
expect(rendered).to have_content('Tag list: dotnet')
|
||||
expect(rendered).to have_content('Refs only: test@dude/repo')
|
||||
expect(rendered).to have_content('Refs except: deploy')
|
||||
expect(rendered).to have_content('Environment: testing')
|
||||
expect(rendered).to have_content('When: on_success')
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue