summaryrefslogtreecommitdiffstats
path: root/spec/qunit_spec.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2013-04-06 14:42:33 -0500
committerkpdecker <kpdecker@gmail.com>2013-04-06 14:42:33 -0500
commitf4d0092bb836f2c12ddf42dfe6be8e16778ffea5 (patch)
tree106e9ac034aa3cc7ce883891ebdb48c675e23a03 /spec/qunit_spec.js
parentfe74d65f2b5d814a2c378394d4b8ec0efcfb45c5 (diff)
downloadhandlebars.js-f4d0092bb836f2c12ddf42dfe6be8e16778ffea5.zip
handlebars.js-f4d0092bb836f2c12ddf42dfe6be8e16778ffea5.tar.gz
handlebars.js-f4d0092bb836f2c12ddf42dfe6be8e16778ffea5.tar.bz2
escapeExpression tests
Diffstat (limited to 'spec/qunit_spec.js')
-rw-r--r--spec/qunit_spec.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/qunit_spec.js b/spec/qunit_spec.js
index 10b20ae..479f64b 100644
--- a/spec/qunit_spec.js
+++ b/spec/qunit_spec.js
@@ -1406,6 +1406,19 @@ test('GS-428: Nested if else rendering', function() {
suite('Utils');
+test('escapeExpression', function() {
+ equal(Handlebars.Utils.escapeExpression('foo<&"\'>'), 'foo&lt;&amp;&quot;&#x27;&gt;');
+ equal(Handlebars.Utils.escapeExpression(new Handlebars.SafeString('foo<&"\'>')), 'foo<&"\'>');
+ equal(Handlebars.Utils.escapeExpression(''), '');
+ equal(Handlebars.Utils.escapeExpression(undefined), '');
+ equal(Handlebars.Utils.escapeExpression(null), '');
+ equal(Handlebars.Utils.escapeExpression(false), '');
+
+ equal(Handlebars.Utils.escapeExpression(0), '0');
+ equal(Handlebars.Utils.escapeExpression({}), {}.toString());
+ equal(Handlebars.Utils.escapeExpression([]), [].toString());
+});
+
test('isEmpty', function() {
equal(Handlebars.Utils.isEmpty(undefined), true);
equal(Handlebars.Utils.isEmpty(null), true);