Skip to content

Commit

Permalink
Merge pull request jashkenas#1991 from gsamokovarov/model-change-test
Browse files Browse the repository at this point in the history
Add test for jashkenas#1989
  • Loading branch information
jashkenas committed Dec 20, 2012
2 parents 83de3d3 + ca88fcd commit 74633ab
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/model.js
Expand Up @@ -593,6 +593,13 @@ $(document).ready(function() {
ok(model.get('x') === a);
});

test("set same value does not trigger change", 0, function() {
var model = new Backbone.Model({x: 1});
model.on('change change:x', function() { ok(false); });
model.set({x: 1});
model.set({x: 1});
});

test("unset does not fire a change for undefined attributes", 0, function() {
var model = new Backbone.Model({x: undefined});
model.on('change:x', function(){ ok(false); });
Expand Down

0 comments on commit 74633ab

Please sign in to comment.