2015-08-25 21:42:46 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe "Lint" do
|
|
|
|
before do
|
|
|
|
login_as :user
|
|
|
|
end
|
|
|
|
|
|
|
|
it "Yaml parsing", js: true do
|
|
|
|
content = File.read(Rails.root.join('spec/support/gitlab_stubs/gitlab_ci.yml'))
|
2015-09-15 09:42:02 -04:00
|
|
|
visit ci_lint_path
|
2015-08-25 21:42:46 -04:00
|
|
|
fill_in "content", with: content
|
|
|
|
click_on "Validate"
|
|
|
|
within "table" do
|
2015-09-10 10:55:09 -04:00
|
|
|
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")
|
2015-08-25 21:42:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it "Yaml parsing with error", js: true do
|
2015-09-15 09:42:02 -04:00
|
|
|
visit ci_lint_path
|
2015-08-25 21:42:46 -04:00
|
|
|
fill_in "content", with: ""
|
|
|
|
click_on "Validate"
|
2015-09-10 10:55:09 -04:00
|
|
|
expect(page).to have_content("Status: syntax is incorrect")
|
|
|
|
expect(page).to have_content("Error: Please provide content of .gitlab-ci.yml")
|
2015-08-25 21:42:46 -04:00
|
|
|
end
|
|
|
|
end
|