Skip to content

Instantly share code, notes, and snippets.

@kyamaguchi
Created May 30, 2012 08:17
Show Gist options
  • Select an option

  • Save kyamaguchi/2834504 to your computer and use it in GitHub Desktop.

Select an option

Save kyamaguchi/2834504 to your computer and use it in GitHub Desktop.
Test with asset pipeline
### 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