Issue #44 -- Model#set, empty string vs null.

This commit is contained in:
Jeremy Ashkenas
2010-11-01 10:26:44 -04:00
parent cd21480e8e
commit f0ecfcd279
2 changed files with 6 additions and 1 deletions

View File

@@ -96,6 +96,12 @@ $(document).ready(function() {
ok(changeCount == 2, "Change count should have incremented for unset.");
});
test("Model: set an empty string", function() {
var model = new Backbone.Model({name : "Model"});
model.set({name : ''});
equals(model.get('name'), '');
});
test("Model: changed, hasChanged, changedAttributes, previous, previousAttributes", function() {
var model = new Backbone.Model({name : "Tim", age : 10});
model.bind('change', function() {