-
Notifications
You must be signed in to change notification settings - Fork 118
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
undefined reference jQuery #47
Comments
I had the same issue with I am actually getting a When trying to go through Ryan Bate's RailsCast on Jasmine I get the following error:
Although app/assets/javascipts/credit_card.js.coffee has the following: CreditCard = cleanNumber: (number) ->
number.replace /[- ]/g, "" With |
CoffeeScript automatically scopes its files. Try setting |
Thanks Ryan! I had started doing stuff like |
Try |
Works a treat and much nicer syntax - thanks |
As a point of interest for anyone reading I've been going through the prags Coffeescipt Book and you can also do: class CreditCard
# code goes here
root = exports ? window # exports for node.js global
root.CreditCard = CreditCard |
The solution to the OP's problem is a missing
As Ryan Bates quite rightly points out in his screencast |
Shouldnt jasmine do this by itself? I saw that jasmine needs jquery-1.3 to make the results on the results page foldable. I dont even need jquery in these particular steps so i think jasmine should load its jquery-1.3 with noConflict. Not sure if this is a jasmine or a jasmine-rails or a jasminerice issue. |
I followed your instructions and wrote a simple failing test in coffeescript. The test fails as expected but i also get an "ReferenceError: jQuery is not defined at [object Object].cleanUp (http://localhost:3000/assets/jasmine-jquery-1.3.1.js?body=1:67:3)" error.
I then put
#=require application
in spec.js.coffee (which in fact requires a copy of jQuery for the application itself) and the error disappears. Is this as it should be or did i missed something in requiring jQuery?The text was updated successfully, but these errors were encountered: