Update Backbone tests to 1.1.1.

This commit is contained in:
John-David Dalton
2014-02-15 14:32:56 -08:00
parent 486ba5fe0a
commit 88d5f5d76c
8 changed files with 300 additions and 121 deletions

View File

@@ -4,10 +4,16 @@
var ajax = Backbone.ajax;
var emulateHTTP = Backbone.emulateHTTP;
var emulateJSON = Backbone.emulateJSON;
var history = window.history;
var pushState = history.pushState;
var replaceState = history.replaceState;
QUnit.testStart(function() {
var env = this.config.current.testEnvironment;
// We never want to actually call these during tests.
history.pushState = history.replaceState = function(){};
// Capture ajax settings for comparison.
Backbone.ajax = function(settings) {
env.ajaxSettings = settings;
@@ -30,6 +36,8 @@
Backbone.ajax = ajax;
Backbone.emulateHTTP = emulateHTTP;
Backbone.emulateJSON = emulateJSON;
history.pushState = pushState;
history.replaceState = replaceState;
});
})();