mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
add test for URL encoding
This commit is contained in:
parent
fd6fd0f1bd
commit
5ef3c4f59c
14
test/test.js
14
test/test.js
@ -291,6 +291,20 @@ describe("Crafatar", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should return correct HTTP response for URL encoded URLs", function(done) {
|
||||||
|
var url = "http://localhost:3000/%61%76%61%74%61%72%73/%6a%6f%6d%6f"; // avatars/jomo
|
||||||
|
request.get(url, function(error, res, body) {
|
||||||
|
assert.ifError(error);
|
||||||
|
assert.strictEqual(res.statusCode, 200);
|
||||||
|
assert_headers(res);
|
||||||
|
assert(res.headers["etag"]);
|
||||||
|
assert.strictEqual(res.headers["content-type"], "image/png");
|
||||||
|
assert.strictEqual(res.headers["etag"], '"bb2ea7307d"');
|
||||||
|
assert(body);
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
var server_tests = {
|
var server_tests = {
|
||||||
"avatar with existing username": {
|
"avatar with existing username": {
|
||||||
url: "http://localhost:3000/avatars/jeb_?size=16",
|
url: "http://localhost:3000/avatars/jeb_?size=16",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user