From d27f762ee26dde5a11c71c7c2d4ad172098addaa Mon Sep 17 00:00:00 2001 From: Miguel Date: Wed, 14 Jan 2015 14:46:01 +0000 Subject: [PATCH] added attribute binding override test --- .../views/view/attribute_bindings_test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/ember-views/tests/views/view/attribute_bindings_test.js b/packages/ember-views/tests/views/view/attribute_bindings_test.js index 0910cbec2ce..3882c7a7725 100644 --- a/packages/ember-views/tests/views/view/attribute_bindings_test.js +++ b/packages/ember-views/tests/views/view/attribute_bindings_test.js @@ -410,3 +410,21 @@ QUnit.test("blacklists href bindings based on protocol", function() { equal(view.$().attr('href'), "javascript:alert('foo')", "value is not defined"); }); + +QUnit.test("attributeBindings should be overridable", function() { + var ParentView = EmberView.extend({ + attributeBindings: ['href'], + href: "an href" + }); + + var ChildView = ParentView.extend({ + attributeBindings: ['newHref:href'], + newHref: "a new href" + }); + + view = ChildView.create(); + + appendView(); + + equal(view.$().attr('href'), "a new href", "expect value from subclass attribute binding"); +});