Remove unused spec support BackgroundJobs (#4464) [ci skip]

This commit is contained in:
rhymes 2019-10-24 22:49:45 +02:00 committed by Mac Siri
parent 8989a52aba
commit d6d251e9ce
3 changed files with 3 additions and 14 deletions

View file

@ -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)

View file

@ -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

View file

@ -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