diff --git a/spec/lib/tasks/scaleway/storage/migrate_from_local_task_spec.rb b/spec/lib/tasks/scaleway/storage/migrate_from_local_task_spec.rb index 786b7f5f..037a5c29 100644 --- a/spec/lib/tasks/scaleway/storage/migrate_from_local_task_spec.rb +++ b/spec/lib/tasks/scaleway/storage/migrate_from_local_task_spec.rb @@ -3,13 +3,15 @@ require "spec_helper" describe "rake scaleway:storage:migrate_from_local", type: :task do + before do + allow(ActiveStorage::Migrator).to receive(:migrate!).with(:local, :scaleway).and_return(true) + end + it "preloads the Rails environment" do expect(task.prerequisites).to include "environment" end it "invokes the migrator" do - expect(ActiveStorage::Migrator).to receive(:migrate!).with(:local, :scaleway).and_return(true) - task.execute end end