diff --git a/app/controllers/wizard_controller.rb b/app/controllers/wizard_controller.rb index 4b7bc82faa4..88edb7af8d4 100644 --- a/app/controllers/wizard_controller.rb +++ b/app/controllers/wizard_controller.rb @@ -3,8 +3,8 @@ require_dependency 'wizard/builder' class WizardController < ApplicationController before_filter :ensure_wizard_enabled, only: [:index] - before_filter :ensure_logged_in - before_filter :ensure_admin + before_filter :ensure_logged_in, except: [:qunit] + before_filter :ensure_admin, except: [:qunit] skip_before_filter :check_xhr, :preload_json @@ -21,6 +21,7 @@ class WizardController < ApplicationController end def qunit + raise Discourse::InvalidAccess.new if Rails.env.production? end end diff --git a/lib/tasks/docker.rake b/lib/tasks/docker.rake index 80af4e74d74..b6089394478 100644 --- a/lib/tasks/docker.rake +++ b/lib/tasks/docker.rake @@ -92,8 +92,9 @@ task 'docker:test' do @good &&= run_or_fail("eslint --ext .es6 test/javascripts") @good &&= run_or_fail("eslint test/javascripts") @good &&= run_or_fail("bundle exec rake qunit:test['600000']") + @good &&= run_or_fail("bundle exec rake qunit:test['600000','/wizard/qunit']") end - + unless ENV["SKIP_PLUGINS"] if ENV["SINGLE_PLUGIN"] @good &&= run_or_fail("bundle exec rake plugin:qunit['#{ENV['SINGLE_PLUGIN']}','600000']") @@ -101,7 +102,7 @@ task 'docker:test' do @good &&= run_or_fail("bundle exec rake plugin:qunit['*','600000']") end end - + end ensure diff --git a/lib/tasks/qunit.rake b/lib/tasks/qunit.rake index af08cb58565..715af0ed6ef 100644 --- a/lib/tasks/qunit.rake +++ b/lib/tasks/qunit.rake @@ -1,6 +1,6 @@ desc "Runs the qunit test suite" -task "qunit:test", [:timeout] => :environment do |_, args| +task "qunit:test", [:timeout, :qunit_path] => :environment do |_, args| require "rack" require "socket" @@ -35,7 +35,8 @@ task "qunit:test", [:timeout] => :environment do |_, args| begin success = true test_path = "#{Rails.root}/vendor/assets/javascripts" - cmd = "phantomjs #{test_path}/run-qunit.js http://localhost:#{port}/qunit" + qunit_path = args[:qunit_path] || "/qunit" + cmd = "phantomjs #{test_path}/run-qunit.js http://localhost:#{port}#{qunit_path}" options = {}