From 679e72759a4bb2d3ef4155d6b759c540d17ec2c9 Mon Sep 17 00:00:00 2001 From: jomo Date: Thu, 28 May 2015 01:05:24 +0200 Subject: [PATCH] fix test for TooManyRequests --- test/test.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/test/test.js b/test/test.js index 6338bde..5949863 100644 --- a/test/test.js +++ b/test/test.js @@ -881,17 +881,21 @@ describe("Crafatar", function() { if (id_type === "uuid") { it("uuid should be rate limited", function(done) { - networking.get_profile(rid, id, function(err, profile) { - assert.ifError(err); - assert.strictEqual(profile.error, "TooManyRequests"); - done(); + networking.get_profile(rid, id, function() { + networking.get_profile(rid, id, function(err, profile) { + assert.strictEqual(err, "TooManyRequests"); + assert.strictEqual(profile.error, "TooManyRequestsException"); + done(); + }); }); }); } else { it("username should NOT be rate limited (username)", function(done) { - helpers.get_avatar(rid, id, false, 160, function(err, status, image) { - assert.strictEqual(err, null); - done(); + helpers.get_avatar(rid, id, false, 160, function() { + helpers.get_avatar(rid, id, false, 160, function(err, status, image) { + assert.strictEqual(err, null); + done(); + }); }); }); }