fix test for TooManyRequests

This commit is contained in:
jomo 2015-05-28 01:05:24 +02:00
parent 0ec97e9ba1
commit 679e72759a

View File

@ -881,17 +881,21 @@ describe("Crafatar", function() {
if (id_type === "uuid") { if (id_type === "uuid") {
it("uuid should be rate limited", function(done) { it("uuid should be rate limited", function(done) {
networking.get_profile(rid, id, function(err, profile) { networking.get_profile(rid, id, function() {
assert.ifError(err); networking.get_profile(rid, id, function(err, profile) {
assert.strictEqual(profile.error, "TooManyRequests"); assert.strictEqual(err, "TooManyRequests");
done(); assert.strictEqual(profile.error, "TooManyRequestsException");
done();
});
}); });
}); });
} else { } else {
it("username should NOT be rate limited (username)", function(done) { it("username should NOT be rate limited (username)", function(done) {
helpers.get_avatar(rid, id, false, 160, function(err, status, image) { helpers.get_avatar(rid, id, false, 160, function() {
assert.strictEqual(err, null); helpers.get_avatar(rid, id, false, 160, function(err, status, image) {
done(); assert.strictEqual(err, null);
done();
});
}); });
}); });
} }