Fix failing spec.

Fix failing spec.

diff --git a/app/jobs/regular/bulk_invite.rb b/app/jobs/regular/bulk_invite.rb
index cd76fed..08b868c 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 046cad0..bf3b7ea 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

GitHub sha: d6e45864

2 Likes