PERF: apply sprockets patch in a test environment (#11034)

When plugin spec is evaluated for the first time, it took 30 seconds to run:
```
rm -rf tmp/* && LOAD_PLUGINS=1 be rspec ./plugins/discourse-solved/spec/requests/topics_controller_spec.rb
```

Applying sprocket patch in test environment solves that issue
This commit is contained in:
Krzysztof Kotlarek
2020-10-27 10:17:21 +11:00
committed by GitHub
parent a5ff9fbe51
commit 61f6f53dab

View File

@@ -8,7 +8,7 @@
# 2. Stop using a concatenator that does tons of work checking for semicolons when # 2. Stop using a concatenator that does tons of work checking for semicolons when
# when rebuilding an asset # when rebuilding an asset
if Rails.env == "development" if Rails.env.development? || Rails.env.test?
module ActionView::Helpers::AssetUrlHelper module ActionView::Helpers::AssetUrlHelper
def asset_path(source, options = {}) def asset_path(source, options = {})