Precompiled Assets Not Used in Rails Testing Environment

I am using Rails 5.1.1, and for our rspec function tests we want to use precompiled assets before running all function tests. (The main reason for this is because capybara-webkit does not support javascript es6 functions)

Assets are successfully precompiled with RAILS_ENV=test rake assets:precompile, however capybara-webkit does not use precompiled assets.

config / environment / test.rb looks like this:

config.assets.prefix = "/assets_test"
config.assets.compile = true
config.serve_static_assets = true
config.assets.js_compressor = Uglifier.new(
  harmony: true #es6 support
)

What do I need to add for a test to use precompiled assets?

+4
source share

No one has answered this question yet.

Source: https://habr.com/ru/post/1679685/


All Articles