jasmine / jasmine-gem

Jasmine ruby gem
681 stars 275 forks source link

Jasmine throws an exception when tests are run in a new Rails 4.1 project #228

Closed eugie closed 10 years ago

eugie commented 10 years ago

We installed Jasmine on a greenfield Rails 4.1 project. When we ran the tests in the browser for the first time, we got this error message:

screen shot 2014-09-09 at 10 27 24 am

screen shot 2014-09-09 at 10 27 43 am

In order to fix this exception, we had to change config.assets.raise_runtime_errors to false in our development.rb.

tjgrathwell commented 10 years ago

@eugie I have an existing Rails 4.1 project with Jasmine 2.0.2 and it turns out this problem only manifests when upgrading sprockets-rails from 2.1.3 (April 11) to 2.1.4 (September 2). So I guess that narrows it down.

Maybe it's this thing: https://github.com/rails/sprockets-rails/issues/167 ?

Temporary workaround is to lock sprockets-rails to 2.1.3 in any bleeding-edge Rails projects.

ragaskar commented 10 years ago

Yep, we tend to break whenever Rails changes its asset handling. I imagine there's a way to patch this to work with the new interface inside the asset handler class -- if anyone has a moment to look at it and figure it out I'd be happy to merge a pull (or talk to @slackersoft, who has been tending the jasmine-gem lately).

slackersoft commented 10 years ago

Alrighty, I've got a fix. We just need to tell sprockets-rails we're in debug mode and it shouldn't yell at us. I want to get some better tests around the assets stuff since the travis build didn't catch this for some reason.