3 var sync = Backbone.sync;
4 var ajax = Backbone.ajax;
5 var emulateHTTP = Backbone.emulateHTTP;
6 var emulateJSON = Backbone.emulateJSON;
7 var history = window.history;
8 var pushState = history.pushState;
9 var replaceState = history.replaceState;
11 QUnit.config.noglobals = true;
13 QUnit.testStart(function() {
14 var env = QUnit.config.current.testEnvironment;
16 // We never want to actually call these during tests.
17 history.pushState = history.replaceState = function(){};
19 // Capture ajax settings for comparison.
20 Backbone.ajax = function(settings) {
21 env.ajaxSettings = settings;
24 // Capture the arguments to Backbone.sync for comparison.
25 Backbone.sync = function(method, model, options) {
31 sync.apply(this, arguments);
36 QUnit.testDone(function() {
39 Backbone.emulateHTTP = emulateHTTP;
40 Backbone.emulateJSON = emulateJSON;
41 history.pushState = pushState;
42 history.replaceState = replaceState;