Commit 3dd6ba51 authored by runawaygo's avatar runawaygo

Fixed the failure testcases. Wrap the template compile with a function.

parent 5cc9baa7
...@@ -8,7 +8,7 @@ describe( 'views/*', function() { ...@@ -8,7 +8,7 @@ describe( 'views/*', function() {
require( [ 'text!app/views/clear_button.html' ], function( html ){ require( [ 'text!app/views/clear_button.html' ], function( html ){
expect( html ).to.be.a( 'string' ); expect( html ).to.be.a( 'string' );
expect( html ).to.match( /completedCount/ ); expect( html ).to.match( /completedCount/ );
expect( Em.Handlebars.compile( html ) ).to.not.throw( Error ); expect( function(){ Em.Handlebars.compile( html ) } ).to.not.throw( Error );
done(); done();
}); });
}); });
...@@ -21,7 +21,7 @@ describe( 'views/*', function() { ...@@ -21,7 +21,7 @@ describe( 'views/*', function() {
expect( html ).to.match( /Todos\.todosController/ ); expect( html ).to.match( /Todos\.todosController/ );
expect( html ).to.match( /Checkbox/ ); expect( html ).to.match( /Checkbox/ );
expect( html ).to.match( /class="toggle"/ ); expect( html ).to.match( /class="toggle"/ );
expect( Em.Handlebars.compile( html ) ).to.not.throw( Error ); expect( function(){ Em.Handlebars.compile( html ) } ).to.not.throw( Error );
done(); done();
}); });
}); });
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
{{#unless content.editing}} {{#unless content.editing}}
{{#view Todos.todosController.todoView contentBinding="content" }} {{#view Todos.todosController.todoView contentBinding="content" }}
{{view Ember.Checkbox valueBinding="content.completed" class="toggle"}} {{view Ember.Checkbox valueBinding="content.completed" class="toggle"}}
{{#view Ember.View tagName="label" todoBinding="content"}} {{#view Ember.View tagName="label" todoBinding="content"}}
{{todo.title}} {{todo.title}}
{{/view}} {{/view}}
{{view Ember.Button target="Todos.todosController" action="removeObject" class="destroy" todoBinding="content"}} {{view Ember.Button target="Todos.todosController" action="removeObject" class="destroy" todoBinding="content"}}
{{/view}} {{/view}}
{{else}} {{else}}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment