6

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

4

1 回答 1

2

这有点像在黑暗中拍摄,但我在使用 Ruby 2.0 的 rails 3.2 应用程序时遇到了同样的问题。显然 Sprockets 没有解析 js/css 要求语句存在问题:

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

于 2013-08-07T06:37:21.553 回答