Skip to content

Commit

Permalink
remove unneeded test code
Browse files Browse the repository at this point in the history
  • Loading branch information
gkatsev committed Dec 30, 2013
1 parent 14bb6e3 commit 8b483fb
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions test/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,6 @@ var runModelTests = function(options) {
model.set({name : 'Rob'}, {silent : true});
equal(model.hasChanged(), true);
equal(model.hasChanged('name'), true);
//model.change();
equal(model.get('name'), 'Rob');
});

Expand All @@ -302,19 +301,6 @@ var runModelTests = function(options) {
equal(model.changedAttributes({a: 'b'}).a, 'b');
});

//test("Model: change with options", function() {
//var value;
//var model = new Backbone.Model({name: 'Rob'});
//model.on('change', function(model, options) {
//value = options.prefix + model.get('name');
//});
//model.set({name: 'Bob'}, {silent: true});
////model.change({prefix: 'Mr. '});
//equal(value, 'Mr. Bob');
//model.set({name: 'Sue'}, {prefix: 'Ms. '});
//equal(value, 'Ms. Sue');
//});

test("Model: change after initialize", function () {
var changed = 0;
var attrs = {id: 1, label: 'c'};
Expand Down Expand Up @@ -560,7 +546,6 @@ var runModelTests = function(options) {
var model = new Backbone.Model({x: 1});
model.on('change:x', function(){ ok(true); });
model.set({x: 2});
//model.change();
});

test("save with `wait` succeeds without `validate`", function() {
Expand Down Expand Up @@ -627,7 +612,6 @@ var runModelTests = function(options) {
model.set({x: true});
deepEqual(events, ['change:y', 'change:x', 'change']);
events = [];
//model.change();
model.set({z: false});
deepEqual(events, ['change:z', 'change']);
});
Expand All @@ -636,15 +620,13 @@ var runModelTests = function(options) {
var model = new Backbone.Model();
model.on('change', function() {
ok(true);
//model.change();
});
model.set({x: true});
});

test("no `'change'` event if no changes", function() {
var model = new Backbone.Model();
model.on('change', function() { ok(false); });
//model.change();
ok(true); // added to supress warning -AF
});

Expand Down Expand Up @@ -721,7 +703,6 @@ var runModelTests = function(options) {
equal(val, 2);
});
model.set({x: true});
//model.change();
});

test("multiple nested changes with silent", function() {
Expand All @@ -748,25 +729,6 @@ var runModelTests = function(options) {
model.set({a: true});
});

//test("Backbone.wrapError triggers `'error'`", 12, function() {
//var resp = {};
//var options = {};
//var model = new Backbone.Model();
//model.on('error', error);
//var callback = Backbone.wrapError(null, model, options);
//callback(model, resp);
//callback(resp);
//callback = Backbone.wrapError(error, model, options);
//callback(model, resp);
//callback(resp);
//function error(_model, _resp, _options) {
//ok(model === _model);
//ok(resp === _resp);
//ok(options === _options);
//}
//});


if (options.nested) {
// reset the Model
Backbone.Model = oldModel;
Expand Down

0 comments on commit 8b483fb

Please sign in to comment.