Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding a test for single quotes in templates

  • Loading branch information...
commit 6866ffb8400f0cbfab6fc487783ba73dba29e0d1 1 parent 0a8a483
@jashkenas jashkenas authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 test/utility.js
View
4 test/utility.js
@@ -34,9 +34,13 @@ $(document).ready(function() {
var basicTemplate = _.template("<%= thing %> is gettin' on my noives!");
var result = basicTemplate({thing : 'This'});
equals(result, "This is gettin' on my noives!", 'can do basic attribute interpolation');
+
var fancyTemplate = _.template("<ul><% for (key in people) { %><li><%= people[key] %></li><% } %></ul>");
result = fancyTemplate({people : {moe : "Moe", larry : "Larry", curly : "Curly"}});
equals(result, "<ul><li>Moe</li><li>Larry</li><li>Curly</li></ul>", 'can run arbitrary javascript in templates');
+
+ var quoteTemplate = _.template("It's its, not it's");
+ equals(quoteTemplate({}), "It's its, not it's");
});
});
Please sign in to comment.
Something went wrong with that request. Please try again.