From a9c182764b5feeb2466c4bb32f7572762f7fab6d Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Thu, 28 Jan 2010 22:10:49 -0800 Subject: added formatters --- test/BinderTest.js | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'test/BinderTest.js') diff --git a/test/BinderTest.js b/test/BinderTest.js index cf2fa31a..450100e4 100644 --- a/test/BinderTest.js +++ b/test/BinderTest.js @@ -129,10 +129,10 @@ BinderTest.prototype.testChangingRadioUpdatesModel = function(){ }; BinderTest.prototype.testChangingCheckboxUpdatesModel = function(){ - var form = compile(''); + var form = compile(''); form.scope.set('model', {}); form.binder.updateView(); - assertEquals('A', form.scope.get('model').price); + assertEquals(true, form.scope.get('model').price); }; BinderTest.prototype.testBindUpdate = function() { @@ -951,3 +951,16 @@ BinderTest.prototype.testItShouldRenderMultiRootHtmlInBinding = function() { '
before acdafter
', x.node.sortedHtml()); }; + +BinderTest.prototype.testItShouldUseFormaterForText = function() { + var x = compile(''); + x.binder.updateView(); + assertEquals(['a','b'], x.scope.get('a')); + var input = x.node.find('input'); + input[0].value = ' x,,yz'; + input.change(); + assertEquals(['x','yz'], x.scope.get('a')); + x.scope.set('a', [1 ,2, 3]); + x.binder.updateView(); + assertEquals('1, 2, 3', input[0].value); +}; -- cgit v1.2.3