Tag: jasmine

TypeError:jasmine.getEnv()。currentSpec为null

当我尝试运行我的茉莉花规格时,我明白了 TypeError: jasmine.getEnv().currentSpec is null in http://localhost:8888/__JASMINE_ROOT__/jasmine.js (line 498) 不知道为什么,甚至不知道从哪里开始寻找。 498行是: return jasmine.getEnv().currentSpec.expect(actual); 我几个月来一直在做茉莉花,但不是这个项目。 我以前从未见过这种情况。 那么,我从哪里开始呢? (这是rails 3.x项目中的茉莉花gem)

undefined | 0 | ReferenceError:严格模式禁止隐式创建全局属性’csrf_token’

所以,这是我遇到的一个非常有趣的问题。 我目前正在构建一个backbone.js – Rails应用程序。 通常只是为了学习目的而构建它。 我(就像任何好的rails dev)在TDD / BDD上做得最好,我遇到了水豚问题。 我有一个集成规范,只测试root_path工作(Backbone历史开始,显示初始信息等…)。 require ‘spec_helper’ describe “RentalProperties”, js: true do describe “GET /” do it “should show a list of properties” do visit root_path eventually{page.should have_content(“Something”)} end end end 我正在使用jasmine,sinon和capybara / rspec / webkit运行测试。 我正在松散地遵循thinkbot上的“Rspec on Rails”一书(顺便说一句很棒的书),以及本教程: http ://tinnedfruit.com/2011/03/03/testing-backbone-apps-with-jasmine- sinon.html 。 运行上面的规范时,我遇到了这个错误: undefined|0|ReferenceError: Strict mode forbids implicit creation […]