diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2015-12-23 10:43:32 +0000 |
---|---|---|
committer | Grzegorz Bizon <grzegorz@gitlab.com> | 2015-12-23 10:43:32 +0000 |
commit | e68ae9c6afd01efcaea228bd7f0b562ec695731a (patch) | |
tree | 90c48e6dc7aa5ff14ff03c19481b5cf450afc11b /spec/features | |
parent | 3b61dc47ec377b857b66f9b2a81a183276163f4e (diff) | |
parent | d74b254d97e253e857a53e0320295966ac27ecff (diff) | |
download | gitlab-ce-e68ae9c6afd01efcaea228bd7f0b562ec695731a.tar.gz |
Merge branch 'fix/ci-lint' into 'master'
Make CI Lint form synchronous
This removes `remote: true` from CI Lint form, making it synchronous
form. This also removes some complexity related to displaying lint
messages.
View also has been updated, removed deprecated Bootstrap 2 tags.
Improved design.
See merge request !2171
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/ci_lint_spec.rb | 39 | ||||
-rw-r--r-- | spec/features/lint_spec.rb | 28 |
2 files changed, 39 insertions, 28 deletions
diff --git a/spec/features/ci_lint_spec.rb b/spec/features/ci_lint_spec.rb new file mode 100644 index 00000000000..e6e73e5e67c --- /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' 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 diff --git a/spec/features/lint_spec.rb b/spec/features/lint_spec.rb deleted file mode 100644 index 5d8f56e2cfb..00000000000 --- a/spec/features/lint_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -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')) - visit ci_lint_path - fill_in "content", with: content - click_on "Validate" - 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 - - it "Yaml parsing with error", js: true do - visit ci_lint_path - fill_in "content", with: "" - click_on "Validate" - expect(page).to have_content("Status: syntax is incorrect") - expect(page).to have_content("Error: Please provide content of .gitlab-ci.yml") - end -end |