FIX: On devices with a weird pixel ratio, tests were failing.

This commit is contained in:
Robin Ward 2014-08-12 17:29:18 -04:00
parent f1572a43e1
commit 233305e96f
1 changed files with 3 additions and 2 deletions

View File

@ -114,9 +114,10 @@ test("isAnImage", function() {
}); });
test("avatarUrl", function() { test("avatarUrl", function() {
var rawSize = Discourse.Utilities.getRawSize;
blank(utils.avatarUrl('', 'tiny'), "no template returns blank"); blank(utils.avatarUrl('', 'tiny'), "no template returns blank");
equal(utils.avatarUrl('/fake/template/{size}.png', 'tiny'), "/fake/template/" + 20*window.devicePixelRatio + ".png", "simple avatar url"); equal(utils.avatarUrl('/fake/template/{size}.png', 'tiny'), "/fake/template/" + rawSize(20) + ".png", "simple avatar url");
equal(utils.avatarUrl('/fake/template/{size}.png', 'large'), "/fake/template/" + 45*window.devicePixelRatio + ".png", "different size"); equal(utils.avatarUrl('/fake/template/{size}.png', 'large'), "/fake/template/" + rawSize(45) + ".png", "different size");
}); });
test("avatarImg", function() { test("avatarImg", function() {