BigW Consortium Gitlab

lint_spec.rb 823 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
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'))
Valery Sizov committed
10
    visit ci_lint_path 
11 12 13
    fill_in "content", with: content
    click_on "Validate"
    within "table" do
14 15 16 17
      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")
18 19 20 21
    end
  end

  it "Yaml parsing with error", js: true do
Valery Sizov committed
22
    visit ci_lint_path
23 24
    fill_in "content", with: ""
    click_on "Validate"
25 26
    expect(page).to have_content("Status: syntax is incorrect")
    expect(page).to have_content("Error: Please provide content of .gitlab-ci.yml")
27 28
  end
end