Skip to content

Commit e4acea2

Browse files
committed
+ test: upload + autoOrientation
1 parent 44025ed commit e4acea2

File tree

1 file changed

+33
-3
lines changed

1 file changed

+33
-3
lines changed

tests/tests.js

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,7 @@ module('FileAPI');
340340
checkFile(_files['dino.png'], 'dino.png', 'image/png', 461003);
341341
checkFile(_files['hello.txt'], 'hello.txt', 'text/plain', 15);
342342
checkFile(_files['image.jpg'], 'image.jpg', 'image/jpeg', 108338);
343-
344-
// @todo: Сейчас через phantom "application/octet-stream"
345-
// checkFile(_files['lebowski.json'], 'lebowski.json', 'application/json', 5392);
343+
// checkFile(_files['lebowski.json'], 'lebowski.json', 'application/json', 5392);
346344
}
347345
});
348346
});
@@ -392,6 +390,38 @@ module('FileAPI');
392390
});
393391

394392

393+
test('upload + autoOrientation', function (){
394+
var queue = FileAPI.queue(start);
395+
396+
stop();
397+
queue.inc();
398+
queue.inc();
399+
400+
FileAPI.upload({
401+
url: 'http://rubaxa.org/FileAPI/server/ctrl.php',
402+
files: { image: FileAPI.getFiles(uploadForm['image.jpg'])[0] },
403+
imageAutoOrientation: true,
404+
complete: function (err, res){
405+
var res = FileAPI.parseJSON(res.responseText);
406+
equal(res.images.image.width, 448, 'imageAutoOrientation.width');
407+
equal(res.images.image.height, 632, 'imageAutoOrientation.height');
408+
queue.next();
409+
}
410+
});
411+
412+
FileAPI.upload({
413+
url: 'http://rubaxa.org/FileAPI/server/ctrl.php',
414+
files: { image: FileAPI.getFiles(uploadForm['image.jpg'])[0] },
415+
imageTransform: { rotate: 'auto' },
416+
complete: function (err, res){
417+
var res = FileAPI.parseJSON(res.responseText);
418+
equal(res.images.image.width, 448, 'imageTransform.rotate.auto.width');
419+
equal(res.images.image.height, 632, 'imageTransform.rotate.auto.height');
420+
queue.next();
421+
}
422+
});
423+
});
424+
395425

396426
FileAPI.html5 && test('upload + multi imageTransform', function (){
397427
var file = FileAPI.getFiles(uploadForm['dino.png'])[0];

0 commit comments

Comments
 (0)