Remove unused spec support BackgroundJobs (#4464) [ci skip]
This commit is contained in:
parent
8989a52aba
commit
d6d251e9ce
3 changed files with 3 additions and 14 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
Loading…
Add table
Reference in a new issue