From 2c86c202e5097c6569df1fbba9da7c51a24dd5c0 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 16 Sep 2016 15:10:37 +0800 Subject: [PATCH] FIX: Randomly failing specs try 2. --- spec/controllers/admin/backups_controller_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/controllers/admin/backups_controller_spec.rb b/spec/controllers/admin/backups_controller_spec.rb index 8ecfe105a9c..080f4eb6c35 100644 --- a/spec/controllers/admin/backups_controller_spec.rb +++ b/spec/controllers/admin/backups_controller_spec.rb @@ -198,7 +198,8 @@ describe Admin::BackupsController do describe "when filename contains invalid characters" do it "should raise an error" do ['灰色.tar.gz', '; echo \'haha\'.tar.gz'].each do |invalid_filename| - xhr :post, :upload_backup_chunk, resumableFilename: invalid_filename, resumableTotalSize: '1' + described_class.any_instance.expects(:has_enough_space_on_disk?).returns(true) + xhr :post, :upload_backup_chunk, resumableFilename: invalid_filename, resumableTotalSize: 1 expect(response.status).to eq(415) expect(response.body).to eq(I18n.t('backup.invalid_filename')) @@ -208,6 +209,8 @@ describe Admin::BackupsController do describe "when filename is valid" do it "should upload the file successfully" do + described_class.any_instance.expects(:has_enough_space_on_disk?).returns(true) + xhr :post, :upload_backup_chunk, resumableFilename: 'test_Site-0123456789.tar.gz', resumableTotalSize: 1,