summaryrefslogtreecommitdiff
path: root/spec/features/ci_lint_spec.rb
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2015-12-22 08:49:12 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2015-12-22 08:49:12 +0100
commit2ed7b964fa56c14e4344530a1e6896c69dded58e (patch)
tree6b7ec9c7358a5fe5e9a2c36f0158e51bf662db10 /spec/features/ci_lint_spec.rb
parentaff713988bb9fe5b1d35f1986f44b5c1af5a5979 (diff)
downloadgitlab-ce-2ed7b964fa56c14e4344530a1e6896c69dded58e.tar.gz
Rename CI lint specs file
Diffstat (limited to 'spec/features/ci_lint_spec.rb')
-rw-r--r--spec/features/ci_lint_spec.rb39
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/features/ci_lint_spec.rb b/spec/features/ci_lint_spec.rb
new file mode 100644
index 00000000000..441a3c702c7
--- /dev/null
+++ b/spec/features/ci_lint_spec.rb
@@ -0,0 +1,39 @@
+require 'spec_helper'
+
+describe 'CI Lint' do
+ before do
+ login_as :user
+ end
+
+ describe 'YAML parsing', js: true do
+ before do
+ visit ci_lint_path
+ fill_in 'content', with: yaml_content
+ click_on 'Validate'
+ end
+
+ 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
+ end
+end