From d6e45864ce3c657b3a13afefaff73ef7ecf8d4e1 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 16 Apr 2019 09:59:35 +0800 Subject: [PATCH] Fix failing spec. --- app/jobs/regular/bulk_invite.rb | 3 +-- spec/jobs/bulk_invite_spec.rb | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/jobs/regular/bulk_invite.rb b/app/jobs/regular/bulk_invite.rb index cd76fed56f6..08b868cddb3 100644 --- a/app/jobs/regular/bulk_invite.rb +++ b/app/jobs/regular/bulk_invite.rb @@ -30,8 +30,7 @@ module Jobs ensure # send notification to user regarding progress notify_user - - FileUtils.rm_rf(csv_path) if csv_path + File.delete(csv_path) if csv_path end private diff --git a/spec/jobs/bulk_invite_spec.rb b/spec/jobs/bulk_invite_spec.rb index 046cad05c24..bf3b7ead035 100644 --- a/spec/jobs/bulk_invite_spec.rb +++ b/spec/jobs/bulk_invite_spec.rb @@ -13,9 +13,9 @@ describe Jobs::BulkInvite do let(:filename) { "#{Invite.base_directory}/#{basename}" } before do - FileUtils.cp( - "#{Rails.root}/spec/fixtures/csv/#{basename}", - filename + Invite.create_csv( + fixture_file_upload("#{Rails.root}/spec/fixtures/csv/#{basename}"), + "bulk_invite" ) end