This commit is contained in:
Sam 2014-05-27 23:39:02 +10:00
parent 69c36cf082
commit d1f0dda636
1 changed files with 6 additions and 2 deletions

View File

@ -28,8 +28,12 @@ test("isAllowedToUploadAFile", function() {
test("avatarTemplate", function(){
var oldCDN = Discourse.CDN;
equal(Discourse.User.avatarTemplate("sam", 1), "/user_avatar/sam/{size}/1.png");
var oldBase = Discourse.BaseUrl;
Discourse.BaseUrl = "frogs.com";
equal(Discourse.User.avatarTemplate("sam", 1), "/user_avatar/frogs.com/sam/{size}/1.png");
Discourse.CDN = "http://awesome.cdn.com";
equal(Discourse.User.avatarTemplate("sam", 1), "http://awesome.cdn.com/user_avatar/sam/{size}/1.png");
equal(Discourse.User.avatarTemplate("sam", 1), "http://awesome.cdn.com/user_avatar/frogs.com/sam/{size}/1.png");
Discourse.CDN = oldCDN;
Discourse.BaseUrl = oldBase;
});