title: undefined|0|ReferenceError: Strict mode forbids implicit creation of global property 'csrf_token'
body: <p>So, this was quite an interesting problem I have been running into.</p>
  
  <p>I am currently building a backbone.js - Rails app. Generally just building this for learning purposes. I am (like any good rails dev) doing my best at TDD/BDD and I ran into a problem with capybara.</p>
  
  <p>I have an integration spec that merely tests root_path works (Backbone history starts, displays initial information, etc...).</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I am running tests with jasmine, sinon, and capybara/rspec/webkit. I am loosely following both the "Rspec on Rails" book by thoughtbot (awesome book by the way), and this tutorial: <a href="http://tinnedfruit.com/2011/03/03/testing-backbone-apps-with-jasmine-sinon.html" rel="noreferrer">http://tinnedfruit.com/2011/03/03/testing-backbone-apps-with-jasmine-sinon.html</a>.</p>
  
  <p>When running the above spec, I came across this error:</p>
  
  <pre><code>undefined|0|ReferenceError: Strict mode forbids implicit creation of global property 'csrf_token'
  </code></pre>
  
  <p>I took a long time sorting this out because there's really nothing google-able for this error. </p>
  
  <p>Eventually I stumbled across using "use strict-mode" in JS. Essentially this will use some new EMCA5 script conventions. It will catch more coding bloopers, and keep you from accessing global variables. All good things.</p>
  
  <p>So I check, and in my sinon.js file, I see:</p>
  
  <pre><code>"use strict";
  </code></pre>
  
  <p>on line 36 of the file. Lo and behold I comment out the line, and my tests work just fine.</p>
  
  <p>Here is my question: Why did use strict mess up csrf? I am assuming this has something to do with csrf_meta_tags in my rails layout. If possible I would like to put this line back in sinon js as I assume its the "right thing to do"</p>
  
  <p>Does anyone have more information on this? I appreciate any details in advance!!</p>