From 45a3652fe6b3b12f44e7359cff7a940afd788406 Mon Sep 17 00:00:00 2001 From: Aaron Ortbals Date: Tue, 14 Jul 2015 14:04:55 -0500 Subject: [PATCH] Failing test for the `classNameBindings` property for the {{link-to}} helper doesn't update in 1.13.x --- packages/ember/tests/helpers/link_to_test.js | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/packages/ember/tests/helpers/link_to_test.js b/packages/ember/tests/helpers/link_to_test.js index a44d695ef26..654192a3637 100644 --- a/packages/ember/tests/helpers/link_to_test.js +++ b/packages/ember/tests/helpers/link_to_test.js @@ -286,6 +286,33 @@ QUnit.test('The {{link-to}} helper supports a custom activeClass', function() { equal(Ember.$('#about-link:not(.active)', '#qunit-fixture').length, 1, 'The other link was rendered without active class'); }); +QUnit.test('The {{link-to}} helper supports \'classNameBindings\' with custom values', function() { + Ember.TEMPLATES.index = compile('

Home

{{#link-to \'about\' id=\'about-link\' classNameBindings=\'foo:foo-is-true:foo-is-false\'}}About{{/link-to}}'); + + Router.map(function() { + this.route('about'); + }); + + App.IndexController = Ember.Controller.extend({ + foo: false + }); + + bootApplication(); + + Ember.run(function() { + router.handleURL('/'); + }); + + equal(Ember.$('#about-link.foo-is-false', '#qunit-fixture').length, 1, 'The about-link was rendered with the falsy class'); + + var controller = container.lookup('controller:index'); + Ember.run(function() { + controller.set('foo', true); + }); + + equal(Ember.$('#about-link.foo-is-true', '#qunit-fixture').length, 1, 'The about-link was rendered with the truthy class after toggling the property'); +}); + QUnit.test('The {{link-to}} helper supports leaving off .index for nested routes', function() { Router.map(function() { this.route('about', function() {