Add a #with helper

This commit is contained in:
wycats
2010-12-21 09:47:01 -08:00
parent 8fccd21283
commit d87ae129c0
2 changed files with 13 additions and 1 deletions
+9 -1
View File
@@ -486,4 +486,12 @@ test("if a context is not found, helperMissing is used", function() {
var context = { hello: "Hello", world: "world" };
shouldCompileTo(string, context, "Hello <a>world</a>")
})
});
module("built-in helpers");
test("with", function() {
var string = "{{#with person}}{{first}} {{last}}{{/with}}";
shouldCompileTo(string, {person: {first: "Alan", last: "Johnson"}}, "Alan Johnson");
});