Thanks, that works.
After thinking about what I was testing, I decided that I should really
have just been checking that the background job ends up in the queue in the
first place.
So for my new tests, I'm ignoring all the messages within the after_commit,
and just checking that the job is in t
On Thu, Jun 28, 2012 at 2:11 PM, Dennis Kuczynski
wrote:
> In an ActiveRecord model, I have an after_commit callback (:enqueue_job)
> which places a job on my background processing queue (Sidekiq)
>
> To test that the callback was firing when the database transaction
> was committed, I was using:
In an ActiveRecord model, I have an after_commit callback (:enqueue_job)
which places a job on my background processing queue (Sidekiq)
To test that the callback was firing when the database transaction
was committed, I was using:
object.should_receive(:enqueue_job) #should pass
Which seems to w