cavneb/website — pull request #5 by jagthedrummer (2014-03-28 22:11:34+00:00)
Title: First pass at an example for a simple test helper

Based on Andy Matthews example : http://www.andymatthews.net/read/2014/03/26/Unit-Testing-Ember.js:-Handlebars-Helpers

This seems like a more direct way than actually trying to render a template, but it feels a little dirty since we're grabbing the `_rawFunction` attribute on the helper. Seems like it might be fragile since it's relying on internal/undocumented implementation details.

Another option would be to do something like Toran has done in his post with rendering a template : http://www.toranbillups.com/blog/archive/2013/02/11/How-to-unit-test-your-handlebars-helper-with-jasmine/

I also attempted the template method, but couldn't get things to work. It seems like the template didn't like to be rendered outside of a view tree. (Or something that I don't currently understand and didn't have time to dig into...)

Thoughts?

Also, do we need/want to encourage people to test bound helpers differently than unbound helpers? The binding part is really being handled by Ember, and is tested there.