Skip to content

Instantly share code, notes, and snippets.

Created January 3, 2012 21:38
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save juliepagano/1557071 to your computer and use it in GitHub Desktop.
Jasmine & Rails 3.1 asset pipeline don't play well together; a workaround
task :copy_jquery_files do
# Jasmine doesn't work with the asset pipeline; therefore we copy the jquery
# files manually.
spec = Gem::Specification.find_by_name("jquery-rails")
jquery_dir = +
"gems" +
"#{}-#{spec.version}" +
"vendor" +
"assets" +
jquery_file = jquery_dir + "jquery.min.js"
jquery_ui_file = jquery_dir + "jquery-ui.min.js"
destination_dir = + "spec" + "javascripts" + "tmp_helpers"
rm_rf destination_dir
mkdir destination_dir
cp jquery_file, destination_dir
cp jquery_ui_file, destination_dir
task :"jasmine:require" => [:copy_jquery_files]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment