Drop not needed bg job after test file has finished.
This commit is contained in:
parent
e8667a1a2d
commit
b566a36797
1 changed files with 14 additions and 1 deletions
|
@ -24,10 +24,13 @@ class ActiveSupport::TestCase
|
|||
# load seeds
|
||||
load "#{Rails.root}/db/seeds.rb"
|
||||
|
||||
# proccess background jobs
|
||||
Delayed::Worker.new.work_off
|
||||
|
||||
# set system mode to done / to activate
|
||||
Setting.set('system_init_done', true)
|
||||
|
||||
setup do
|
||||
def setup
|
||||
|
||||
# clear cache
|
||||
Cache.clear
|
||||
|
@ -37,5 +40,15 @@ class ActiveSupport::TestCase
|
|||
UserInfo.current_user_id = nil
|
||||
end
|
||||
|
||||
# cleanup jobs
|
||||
def teardown
|
||||
puts 'teardown'
|
||||
|
||||
# check if jobs are proccessed
|
||||
if !Delayed::Job.all.empty?
|
||||
Delayed::Job.all.destroy_all
|
||||
end
|
||||
end
|
||||
|
||||
# Add more helper methods to be used by all tests here...
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue