FileAPI icon indicating copy to clipboard operation
FileAPI copied to clipboard

Allow all 2xx codes

Open ogonkov opened this issue 8 years ago • 6 comments

All 2xx codes would be treated as the success one

ogonkov avatar Jun 13 '17 08:06 ogonkov

@RubaXa а что с тестовой картинкой?

Running "curl:jpg" (curl) task

Verifying property curl.jpg exists in config...OK

Files: [no src] -> tests/files/big.jpg

Warning: Fetching "https://dl.dropboxusercontent.com/u/49592745/BigJPG.jpg" failed with HTTP status code 404 Use --force to continue.

Aborted due to warnings.

npm ERR! Test failed.  See above for more details.

The command "npm test" exited with 1.

ogonkov avatar Jun 13 '17 11:06 ogonkov

@ogonkov да, с картинкой какая-то лажа произошла, в субботу буду разбираться.

RubaXa avatar Jun 14 '17 07:06 RubaXa

@ogonkov готово, файл вернули, влейте актуальный мастер.

RubaXa avatar Jun 19 '17 13:06 RubaXa

Тесты не знаю куда воткнуть, открыл файл с тестами, испугался и закрыл

ogonkov avatar Jun 21 '17 08:06 ogonkov

А в чём проблема?

Нужно сделать подобное:

	test('upload file', function (){
		stop();

		FileAPI.upload({
			url: controllerUrl,
			files: { text: FileAPI.getFiles(uploadForm['hello.txt']) },
			data: {allowedStatus: 232},
			complete: function (err, res, xhr) {
				start();
				// тут проверяем статус xhr
			}
		});
	});

Тут нужна обработка allowedStatus https://github.com/mailru/FileAPI/blob/master/node/server.js#L29-L47

RubaXa avatar Jun 21 '17 08:06 RubaXa

ok, завтра гляну подробнее

ogonkov avatar Jun 21 '17 09:06 ogonkov