From da9aaa7b1e73093c343465807005baed5a52afce Mon Sep 17 00:00:00 2001 From: Geoffrey Pursell Date: Wed, 3 Aug 2016 15:45:05 -0500 Subject: [PATCH] add a unit test to address a bug in the underscore engine --- test/engine_underscore_tests.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/engine_underscore_tests.js b/test/engine_underscore_tests.js index b5beb95e3..06583de00 100644 --- a/test/engine_underscore_tests.js +++ b/test/engine_underscore_tests.js @@ -72,6 +72,17 @@ exports['engine_underscore'] = { // test test.equals(helloWorldWithData.render(), 'Hello world!' + eol + 'Yeah, we got the subtitle from the JSON.' + eol); test.done(); + }, + 'findPartial return the ID of the partial, given a whole partial call': function (test) { + var engineLoader = require('../core/lib/pattern_engines'); + var underscoreEngine = engineLoader.underscore; + + test.expect(1); + + // do all the normal processing of the pattern + // test + test.equals(underscoreEngine.findPartial("<%= _.renderNamedPartial('molecules-details', obj) %>"), 'molecules-details'); + test.done(); } };