Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assets precompilation is run when running tests #371

Closed
diaclavijo opened this issue Aug 4, 2016 · 3 comments
Closed

Assets precompilation is run when running tests #371

diaclavijo opened this issue Aug 4, 2016 · 3 comments

Comments

@diaclavijo
Copy link

You can visit this project

It is an small application to show that sprockets-rails 3.1 is precompiling the assets when
the specs require them even having the configuration assets.compile = true.

This application raise an exception when the precompilation of the assets is executed. This is to
proof that assets precompilation is run when running tests that require them.

The test spec/views/welcome/index.html.erb_spec.rb just renders a view which calls
<%= stylesheet_link_tag 'index' %> .

This test fails in sprockets-rails 3.1 when trying to run the assets precompilation.
You can checkout from the commit and run specs.

But it passes in sprockets-rails 2.3 as it compiles the file on demand.
You can checkout from the commit and run specs.

I expected that if you have assets.compile = true it will never run precompilation and always
compile assets on demand.

Am I understanding something wrong here?

@Jared-Prime
Copy link

Jared-Prime commented Aug 17, 2016

I may be seeing something related to this issue. I have tests failing during asset compilation following an upgrade of Rails 4.1.16 to Rails 4.2.7.1, which brings with it an upgrade of sprockets-rails from 2.3.3 to 3.1.1. My remedy thus far is to lock sprockets-rails at 2.x

@rafaelfranca
Copy link
Member

Duplicated of #352

@diaclavijo
Copy link
Author

Thank you very much @rafaelfranca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants