Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Daniel Dyba's Profile

GitHub User: dyba


Comments by Daniel Dyba


Here's something I grabbed from the Jasmine Google Group:

By default Jasmine will load files you place in spec/javascripts/helpers. You'll want to put the version of jquery that Rails provides (and jquery-ui, if you're using it) in there in order for Jasmine to be able to load it for your tests. Rails normally provides these to the asset pipeline via the jquery-rails gem, which jasmine doesn't yet interact with.

Hope this helps!

Thanks for using Jasmine!



Just as I suspected. When I downloaded the jQuery file to my public/javascripts/ folder, Jasmine worked just fine. You can use this as a temporary hack.


I don't think there's support for Jasmine and Rails 3.1 yet if you are using the asset pipeline. I'm trying to figure out why my tests aren't working, and it seems to me it is because the jQuery files are loaded when the pages of my Rails app load.


This doesn't seem to work with FactoryGirl. When I turn transactional fixtures off, all of my specs depending on FactoryGirl fail. :'(