Created
November 29, 2011 13:39
-
-
Save zubairov/1404830 to your computer and use it in GitHub Desktop.
Defaults are not inherited in backbone.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
suite('Bug', function() { | |
suite('Backbone.js basic functionality', function() { | |
test('Defaults are inherited', function() { | |
var One = Backbone.Model.extend({ | |
defaults : { | |
children : [] | |
} | |
}); | |
var Two = One.extend(); | |
var Three = One.extend({ | |
defaults: { | |
fubar : 'value' | |
} | |
}); | |
assert.ok((new One).has('children'), 'One has no children'); | |
assert.ok((new Two).has('children'), 'Two has no children'); | |
assert.ok((new Three).has('fubar'), 'Three has no fubar'); | |
assert.ok((new Three).has('children'), 'Three has no children'); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment