[Pkg-javascript-commits] [backbone] 80/281: add tests for #730 and #565
Jonas Smedegaard
js at moszumanska.debian.org
Sat May 3 17:01:58 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to tag 0.9.0
in repository backbone.
commit 93ad86cfa9fe5b6aa7b70d6cac232fe40a2879c8
Author: Brad Dunbar <dunbarb2 at gmail.com>
Date: Thu Nov 10 13:45:27 2011 -0500
add tests for #730 and #565
---
test/model.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/test/model.js b/test/model.js
index 5778097..ac1ab0a 100644
--- a/test/model.js
+++ b/test/model.js
@@ -204,11 +204,18 @@ $(document).ready(function() {
test("Model: clear", function() {
var changed;
- var model = new Backbone.Model({name : "Model"});
+ var model = new Backbone.Model({id: 1, name : "Model"});
model.bind("change:name", function(){ changed = true; });
+ model.bind("change", function() {
+ var changedAttrs = model.changedAttributes();
+ ok('name' in changedAttrs);
+ ok(!('id' in changedAttrs));
+ });
model.clear();
equals(changed, true);
equals(model.get('name'), undefined);
+ equals(model.id, 1);
+ equals(model.get('id'), 1);
});
test("Model: defaults", function() {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/backbone.git
More information about the Pkg-javascript-commits
mailing list