I have an API project in Rails 5 using rswag for endpoint definition and testing.
One controller action, create
, enqueues an ActiveJob with keyword arguments using perform_later(job_title: @job, date: @date)
When I use run_test!
in my request spec for this action, I want to run the queued job immediately.
How do I force the job to run with the keyword arguments that were passed in the controller action?
You can use
perform_enqueued_jobs
inside yourrun_test!
block