mirror of
https://github.com/jashkenas/backbone.git
synced 2026-04-30 03:00:06 -04:00
Issue #44 -- Model#set, empty string vs null.
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user