Tag: sinon

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 […]