[Pkg-javascript-commits] [backbone] 17/23: Addinga a test case for #459

Jonas Smedegaard js at moszumanska.debian.org
Sat May 3 17:00:44 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.5.1
in repository backbone.

commit fcbedad8cdecc4dfd5c9190ca1aadb67606596ed
Author: Jeremy Ashkenas <jashkenas at gmail.com>
Date:   Tue Jul 5 09:00:12 2011 -0400

    Addinga a test case for #459
---
 test/model.js | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/test/model.js b/test/model.js
index c31d516..142857c 100644
--- a/test/model.js
+++ b/test/model.js
@@ -357,6 +357,17 @@ $(document).ready(function() {
     equals(boundError, undefined);
   });
 
+  test("Model: defaults always extend attrs (#459)", function() {
+    var Defaulted = Backbone.Model.extend({
+      defaults: {one: 1},
+      initialize : function(attrs, opts) {
+        equals(attrs.one, 1);
+      }
+    });
+    var providedattrs = new Defaulted({});
+    var emptyattrs = new Defaulted();
+  });
+
   test("Model: Inherit class properties", function() {
     var Parent = Backbone.Model.extend({
       instancePropSame: 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