I have this code to test ActiveJob and ActionMailer with Rspec I don\'t know how really execute all enqueued job
describe \'whatever\' do
include ActiveJob::
The proper way to test will be to check number of enqueued jobs as in your example, and then test each job separately. If you want to do integration testing you can try perform_enqueued_jobs helper:
describe 'whatever' do
include ActiveJob::TestHelper
after do
clear_enqueued_jobs
end
it 'should email' do
perform_enqueued_jobs do
SomeClass.some_action
end
end
end
See ActiveJob::TestHelper docs