FIX: Randomly failing specs.

This commit is contained in:
Guo Xiang Tan 2016-09-16 14:56:59 +08:00
parent 770c5ea378
commit 903d1dd326

View file

@ -198,7 +198,7 @@ describe Admin::BackupsController do
describe "when filename contains invalid characters" do describe "when filename contains invalid characters" do
it "should raise an error" do it "should raise an error" do
['灰色.tar.gz', '; echo \'haha\'.tar.gz'].each do |invalid_filename| ['灰色.tar.gz', '; echo \'haha\'.tar.gz'].each do |invalid_filename|
xhr :post, :upload_backup_chunk, resumableFilename: invalid_filename, resumableTotalSize: '1' xhr :post, :upload_backup_chunk, resumableFilename: invalid_filename, resumableTotalSize: '0'
expect(response.status).to eq(415) expect(response.status).to eq(415)
expect(response.body).to eq(I18n.t('backup.invalid_filename')) expect(response.body).to eq(I18n.t('backup.invalid_filename'))
@ -210,7 +210,7 @@ describe Admin::BackupsController do
it "should upload the file successfully" do it "should upload the file successfully" do
xhr :post, :upload_backup_chunk, xhr :post, :upload_backup_chunk,
resumableFilename: 'test.tar.gz', resumableFilename: 'test.tar.gz',
resumableTotalSize: '1', resumableTotalSize: '0',
resumableIdentifier: 'test', resumableIdentifier: 'test',
resumableChunkNumber: '1', resumableChunkNumber: '1',
resumableChunkSize: '1', resumableChunkSize: '1',