Created
May 30, 2012 08:17
-
-
Save kyamaguchi/2834504 to your computer and use it in GitHub Desktop.
Test with asset pipeline
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### config/environments/test.rb | |
| ... | |
| # Add assets settings to be identical to production env | |
| # Using | |
| if ENV['ASSETS'] | |
| puts "ENV['ASSETS'] is given. Set asset pipeling configurations." | |
| # Compress JavaScripts and CSS | |
| config.assets.compress = true | |
| # Don't fallback to assets pipeline if a precompiled asset is missed | |
| config.assets.compile = false | |
| # Generate digests for assets URLs | |
| config.assets.digest = true | |
| config.assets.precompile += %w( participations.js participations.css ) | |
| end | |
| end | |
| # Run test | |
| # $ rake assets:clean | |
| # $ rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile | |
| # $ ASSETS=true rake spec | |
| # ($ unset ASSETS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment