From 85014a4f6c7617b69f5b5b7449129b86f955fbf3 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Sat, 22 Sep 2012 13:34:05 -0700 Subject: [PATCH] Add spec for partial caching issue --- test/writer_test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/writer_test.js b/test/writer_test.js index 8fcd6e1..f2253d5 100644 --- a/test/writer_test.js +++ b/test/writer_test.js @@ -16,6 +16,19 @@ vows.describe("Mustache.Writer").addBatch({ }); assert.equal(result, partial); + }, + "caches partials by content, not by name": function (writer) { + var result = writer.render("{{>partial}}", {}, { + partial: "partial one" + }); + + assert.equal(result, "partial one"); + + result = writer.render("{{>partial}}", {}, { + partial: "partial two" + }); + + assert.equal(result, "partial two"); } } }).export(module);