How to check if rake task was finished?
问题 This is my first experience with RoR and I using the rspec tool to test my controller. But inside the methods, I using rake tasks to create asynchronous solutions like this: def scan_all_urls system 'rake scan_all_urls &' end And my rake task is this: task :scan_all_urls => :environment do crawler = Crawler.new urls = Url.all crawler.scan_urls(urls) end But my issue is, at the rspec test: it 'should scan all url' do params = {} get 'scan_all_urls', params: params, format: :json end How I