From 6c0a29698bed3e66eecc33bf083815e407c13c40 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 25 Jul 2017 16:29:27 +0900 Subject: [PATCH] Fix JS tests failing when running in `RAILS_ENV=test`. Fixes the following error: ``` phantomjs /home/tgxworld/work/discourse/vendor/assets/javascripts/run-qunit.js http://localhost:60099/qunit 2017-07-25 16:27:41 +0900: Rack app error handling request { GET /stylesheets/desktop.css } /home/tgxworld/work/discourse/app/controllers/stylesheets_controller.rb:65:in `write' /home/tgxworld/work/discourse/app/controllers/stylesheets_controller.rb:65:in `show_resource' /home/tgxworld/work/discourse/app/controllers/stylesheets_controller.rb:9:in `show' ``` --- app/controllers/stylesheets_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/controllers/stylesheets_controller.rb b/app/controllers/stylesheets_controller.rb index dea3d5d34c5..8d1328e0f2b 100644 --- a/app/controllers/stylesheets_controller.rb +++ b/app/controllers/stylesheets_controller.rb @@ -21,7 +21,7 @@ class StylesheetsController < ApplicationController target,digest = params[:name].split(/_([a-f0-9]{40})/) - if Rails.env == "development" + if !Rails.env.production? # TODO add theme # calling this method ensures we have a cache for said target # we hold of re-compilation till someone asks for asset @@ -90,4 +90,3 @@ class StylesheetsController < ApplicationController end end -