From dd6e38133aa1e692a98e6bf939a7743535c8f257 Mon Sep 17 00:00:00 2001 From: Sam Saffron Date: Tue, 15 Dec 2015 19:46:00 +1100 Subject: [PATCH] correct tests and implemenation --- app/assets/javascripts/discourse/lib/utilities.js | 2 +- test/javascripts/lib/utilities-test.js.es6 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/lib/utilities.js b/app/assets/javascripts/discourse/lib/utilities.js index 2668b7573..3feff3114 100644 --- a/app/assets/javascripts/discourse/lib/utilities.js +++ b/app/assets/javascripts/discourse/lib/utilities.js @@ -82,7 +82,7 @@ Discourse.Utilities = { var classes = "avatar" + (options.extraClasses ? " " + options.extraClasses : ""); var title = (options.title) ? " title='" + Handlebars.Utils.escapeExpression(options.title || "") + "'" : ""; - return "" + (title || "avatar") + ""; + return "" + (options.title || "avatar") + ""; }, tinyAvatar: function(avatarTemplate, options) { diff --git a/test/javascripts/lib/utilities-test.js.es6 b/test/javascripts/lib/utilities-test.js.es6 index 273243108..0d0c0f48a 100644 --- a/test/javascripts/lib/utilities-test.js.es6 +++ b/test/javascripts/lib/utilities-test.js.es6 @@ -130,7 +130,7 @@ test("avatarImg", function() { "it returns the avatar html"); equal(utils.avatarImg({avatarTemplate: avatarTemplate, size: 'tiny', title: 'evilest trout'}), - "avatar", + "evilest trout", "it adds a title if supplied"); equal(utils.avatarImg({avatarTemplate: avatarTemplate, size: 'tiny', extraClasses: 'evil fish'}),