我有一个茉莉花规格套装,适用于那些不在我公司的人。我正在尝试运行
rake jasmine
然而,当规格运行时,它们都会失败。我确信资产管道没有加载,因为我收到如下错误:
ReferenceError: jQuery is not defined
这是我的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
这是我的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 .
有没有人有任何建议
答案 0 :(得分:2)
这在黑暗中有点像,但我在使用Ruby 2.0的rails 3.2应用程序时遇到了同样的问题。显然,Sprockets没有解析js / css require语句存在问题: