diff --git a/spec/models/notification_spec.rb b/spec/models/notification_spec.rb index 8c322ac10..20b4d9bcd 100644 --- a/spec/models/notification_spec.rb +++ b/spec/models/notification_spec.rb @@ -90,13 +90,13 @@ RSpec.describe Notification, type: :model do let(:tag_follow) { user.follow(tag) } it "runs fine" do - run_background_jobs_immediately do + perform_enqueued_jobs do described_class.send_new_follower_notification(tag_follow) end end it "doesn't create a notification" do - run_background_jobs_immediately do + perform_enqueued_jobs do expect do described_class.send_new_follower_notification(tag_follow) end.not_to change(described_class, :count) diff --git a/spec/observers/comment_observer_spec.rb b/spec/observers/comment_observer_spec.rb index cecbc856a..b875359ae 100644 --- a/spec/observers/comment_observer_spec.rb +++ b/spec/observers/comment_observer_spec.rb @@ -12,7 +12,7 @@ RSpec.describe CommentObserver, type: :observer do perform_enqueued_jobs do user.add_role :warned Comment.observers.enable :comment_observer do - run_background_jobs_immediately do + perform_enqueued_jobs do create(:comment, user: user, commentable: article) end end diff --git a/spec/support/background_jobs.rb b/spec/support/background_jobs.rb deleted file mode 100644 index 1c70c5b08..000000000 --- a/spec/support/background_jobs.rb +++ /dev/null @@ -1,11 +0,0 @@ -module BackgroundJobs - def run_background_jobs_immediately - Delayed::Worker.delay_jobs = false - yield - Delayed::Worker.delay_jobs = true - end -end - -RSpec.configure do |config| - config.include BackgroundJobs -end