diff --git a/app/controllers/ci/lints_controller.rb b/app/controllers/ci/lints_controller.rb index 7ed78ff8e989492249818665fc8ae1a7c6ea5784..e782a51e7eb93dce8ca605dd2236cd749a272119 100644 --- a/app/controllers/ci/lints_controller.rb +++ b/app/controllers/ci/lints_controller.rb @@ -19,8 +19,10 @@ module Ci @error = e.message @status = false rescue - @error = "Undefined error" + @error = 'Undefined error' @status = false + ensure + render :show end end end diff --git a/app/views/ci/lints/_create.html.haml b/app/views/ci/lints/_create.html.haml index 77f78caa8d886ac22324b676429399862314e8e3..f7875e68b7e668745e10e238e7c7d1899b820a66 100644 --- a/app/views/ci/lints/_create.html.haml +++ b/app/views/ci/lints/_create.html.haml @@ -41,5 +41,3 @@ %i.fa.fa-remove.incorrect-syntax %b Error: = @error - - diff --git a/app/views/ci/lints/create.js.haml b/app/views/ci/lints/create.js.haml deleted file mode 100644 index a96c0b11b6e06cb89baed0c3730f8c028883f675..0000000000000000000000000000000000000000 --- a/app/views/ci/lints/create.js.haml +++ /dev/null @@ -1,2 +0,0 @@ -:plain - $(".results").html("#{escape_javascript(render "create")}") \ No newline at end of file diff --git a/app/views/ci/lints/show.html.haml b/app/views/ci/lints/show.html.haml index fb9057e4882069229f557c83af711e1dbc719ab3..a144c43be477a260ccdad87422f114634285f135 100644 --- a/app/views/ci/lints/show.html.haml +++ b/app/views/ci/lints/show.html.haml @@ -1,27 +1,17 @@ %h2 Check your .gitlab-ci.yml %hr -= form_tag ci_lint_path, method: :post, remote: true do - .control-group - = label_tag :content, "Content of .gitlab-ci.yml", class: 'control-label' - .controls - = text_area_tag :content, nil, class: 'form-control span1', rows: 7, require: true +.row + = form_tag ci_lint_path, method: :post do + .form-group + = label_tag :content, 'Content of .gitlab-ci.yml', class: 'control-label text-nowrap' + .col-sm-12 + = text_area_tag :content, nil, class: 'form-control span1', rows: 7, require: true + .col-sm-12 + .pull-left.prepend-top-10 + = submit_tag 'Validate', class: 'btn btn-success submit-yml' - .control-group.clearfix - .controls.pull-left.prepend-top-10 - = submit_tag "Validate", class: 'btn btn-success submit-yml' - - -%p.text-center.loading - %i.fa.fa-refresh.fa-spin - -.results.prepend-top-20 - -:javascript - $(".loading").hide(); - $('form').bind('ajax:beforeSend', function() { - $(".loading").show(); - }); - $('form').bind('ajax:complete', function() { - $(".loading").hide(); - }); +.row.prepend-top-20 + .col-sm-12 + .results + = render partial: 'create' if defined?(@status) diff --git a/spec/features/ci_lint_spec.rb b/spec/features/ci_lint_spec.rb index 441a3c702c71421d1ed79c9098e7c059dbbb15a6..e6e73e5e67ca34dd3ea2734fc30842bdf0d9c6a2 100644 --- a/spec/features/ci_lint_spec.rb +++ b/spec/features/ci_lint_spec.rb @@ -5,7 +5,7 @@ describe 'CI Lint' do login_as :user end - describe 'YAML parsing', js: true do + describe 'YAML parsing' do before do visit ci_lint_path fill_in 'content', with: yaml_content