mirror of
https://github.com/azures04/crafatar.git
synced 2026-03-21 23:41:18 +01:00
Test default images on all paths
This commit is contained in:
parent
04cd39ae9f
commit
2d0af06122
24
test/test.js
24
test/test.js
@ -225,19 +225,23 @@ describe("Server", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should return a 404 (default steve image)", function(done) {
|
locations = ["avatars", "capes", "skins"]
|
||||||
request.get('http://localhost:3000/avatars/invalidjsvns?default=steve', function(error, res, body) {
|
for (var l in locations) {
|
||||||
assert.equal(404, res.statusCode);
|
var location = locations[l];
|
||||||
done();
|
it("should return a 404 (default steve image " + location + ")", function(done) {
|
||||||
|
request.get('http://localhost:3000/' + location + '/invalidjsvns?default=steve', function(error, res, body) {
|
||||||
|
assert.equal(404, res.statusCode);
|
||||||
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
it("should return a 200 (default external image)", function(done) {
|
it("should return a 200 (default external image " + location + ")", function(done) {
|
||||||
request.get('http://localhost:3000/avatars/invalidjsvns?default=https%3A%2F%2Fi.imgur.com%2FocJVWAc.png', function(error, res, body) {
|
request.get('http://localhost:3000/' + location + '/invalidjsvns?default=https%3A%2F%2Fi.imgur.com%2FocJVWAc.png', function(error, res, body) {
|
||||||
assert.equal(200, res.statusCode);
|
assert.equal(200, res.statusCode);
|
||||||
done();
|
done();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
|
||||||
it("should return a 404 (no cape)", function(done) {
|
it("should return a 404 (no cape)", function(done) {
|
||||||
request.get('http://localhost:3000/capes/Jake0oo0', function(error, res, body) {
|
request.get('http://localhost:3000/capes/Jake0oo0', function(error, res, body) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user