2015-08-26 01:42:46 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-12-22 07:47:23 +00:00
|
|
|
describe 'CI Lint' do
|
2015-08-26 01:42:46 +00:00
|
|
|
before do
|
|
|
|
login_as :user
|
|
|
|
end
|
|
|
|
|
2015-12-22 07:47:23 +00:00
|
|
|
describe 'YAML parsing', js: true do
|
|
|
|
before do
|
|
|
|
visit ci_lint_path
|
|
|
|
fill_in 'content', with: yaml_content
|
|
|
|
click_on 'Validate'
|
2015-08-26 01:42:46 +00:00
|
|
|
end
|
|
|
|
|
2015-12-22 07:47:23 +00:00
|
|
|
context 'YAML is correct' do
|
|
|
|
let(:yaml_content) do
|
|
|
|
File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'Yaml parsing' do
|
|
|
|
within "table" do
|
|
|
|
expect(page).to have_content('Job - rspec')
|
|
|
|
expect(page).to have_content('Job - spinach')
|
|
|
|
expect(page).to have_content('Deploy Job - staging')
|
|
|
|
expect(page).to have_content('Deploy Job - production')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'YAML is incorrect' do
|
|
|
|
let(:yaml_content) { '' }
|
|
|
|
|
|
|
|
it 'displays information about an error' do
|
|
|
|
expect(page).to have_content('Status: syntax is incorrect')
|
|
|
|
expect(page).to have_content('Error: Please provide content of .gitlab-ci.yml')
|
|
|
|
end
|
|
|
|
end
|
2015-08-26 01:42:46 +00:00
|
|
|
end
|
|
|
|
end
|