Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jasmine not loading asset pipeline

I have a jasmine spec set that worked at some point in time for people that are not at my company anymore. I am trying to run

rake jasmine

however, when the specs run they all fail. I am sure that the asset pipeline is not loading because I get errors like:

ReferenceError: jQuery is not defined

this is my jasmine.yml

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

stylesheets:
  - 'app/assets/stylesheets/application.css'
  # - assets/application.css
  # - stylesheets/**/*.css

helpers:
  - 'helpers/**/*.js'

spec_files:
  - '**/*[sS]pec.js'

# src_dir
#
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
# Default: project root
#
# EXAMPLE:
#
# src_dir: public
#
# src_dir: app/assets

spec_dir: spec/javascripts

This is my application.js

// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery-ui
//= require jquery_ujs
//= require jquery.tipTip
//= require jquery.endless-scroll
//= require jquery.groupedautocomplete
//= require jquery.waituntilexists
//= require jquery-ui-timepicker-addon
//= require vendor/jquery.tagsinput
//= require jquery.contextMenu
//= require moment
//= require application_init
//= require lib/behavior
//= require tooltip

//= require underscore
//= require backbone
//= require tent
//= require lib/backbone.store
//= require backbone_rails_sync
//= require backbone_datalink
//= require inflection
//= require haml
//= require jquery.toObject
//= require js2form
//= require form2js
//= require_tree ./backbone/models
//= require_tree ../templates
//= require ./lib/presenters/presenter
//= require table-fixed-header
//= require_tree .

Does anyone have any suggestions

like image 447
richsoni Avatar asked Feb 21 '13 20:02

richsoni


1 Answers

This is somewhat of a shot in the dark but I had the same issue with a rails 3.2 app using Ruby 2.0. Apparently there is an issue with Sprockets not parsing the js/css require statements:

https://github.com/sstephenson/sprockets/issues/352

like image 126
louism2 Avatar answered Nov 03 '22 01:11

louism2