Sfoglia il codice sorgente

fix tests for f088c27012c0c49ad47538373d083311dccaf7d9

jomo 9 anni fa
parent
commit
183e8cfa9c
1 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 3 3
      test/test.js

+ 3 - 3
test/test.js

@@ -293,7 +293,7 @@ describe("Crafatar", function() {
       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.strictEqual(res.statusCode, 201);
         assert_headers(res);
         assert(res.headers.etag);
         assert.strictEqual(res.headers["content-type"], "image/png");
@@ -322,7 +322,7 @@ describe("Crafatar", function() {
         function req() {
           request.get(url, function(error, res, body) {
             assert.ifError(error);
-            assert.strictEqual(res.statusCode, 200);
+            assert.strictEqual(res.statusCode === 201 || res.statusCode === 200, true);
             assert_headers(res);
             assert(res.headers.etag);
             assert.strictEqual(res.headers["content-type"], "image/png");
@@ -763,7 +763,7 @@ describe("Crafatar", function() {
               done();
             } else {
               assert.strictEqual(res.headers["content-type"], "image/png");
-              assert.strictEqual(res.statusCode, 200);
+              assert.strictEqual(res.statusCode, res.headers["x-storage-type"] === "downloaded" ? 201 : 200);
               assert(res.headers.etag);
               assert.strictEqual(res.headers.etag, '"' + hash + '"');
               assert_cache(location.url, res.headers.etag, function() {