Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jasmine won't load javascript files from asset pipeline

I'm developing a gem and I've installed Jasmine https://github.com/pivotal/jasmine-gem/

All of my required JS files are in my manifest file at app/assets/javascripts/application.js

//= require underscore
//= require backbone

//= require_tree .//vendor
//= require_tree .//custom

//= require_tree .//templates
//= require_tree .//models
//= require_tree .//collections
//= require_tree .//views

And my jasmine.yml file references that:

src_files:
  - 'app/assets/javascripts/application.js'

But none of the files specified in it load. Anyone know why? I'm using the latest, Jasmine 1.3.2, which is supposed to support the asset pipeline so that you don't need to use something like jasmine-rails. Any thoughts?

like image 1000
fourthnen Avatar asked Mar 13 '13 19:03

fourthnen


2 Answers

In your jasmine.yml the path should be 'assets/application.js'. If you're still having trouble, make sure you have your jasmine gem under both development and test groups in your Gemfile, as specified in the instructions on https://github.com/pivotal/jasmine-gem:

group :development, :test do
  gem 'jasmine'
end
like image 177
jackocnr Avatar answered Nov 15 '22 15:11

jackocnr


If you are using Rails 4 there is bug in version 1.3.2 where is it checking config.assets.enabled which no longer is defined in Rails 4.

The following worked for me. gem 'jasmine', "~> 2.0.0.rc4"

This is the ticket that talks about the issue. https://github.com/pivotal/jasmine-gem/pull/177

like image 32
zznq Avatar answered Nov 15 '22 16:11

zznq