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 }
<Errno::ENOENT: No such file or directory @ rb_sysopen - /home/tgxworld/work/discourse/tmp/stylesheet-cache/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'
```
This commit is contained in:
Guo Xiang Tan 2017-07-25 16:29:27 +09:00
parent 8a362a1c3c
commit 6c0a29698b

@ -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