Re: [rspec-users] Issue when testing ActiveRecord after_commit callbacks

2012-06-29 Thread Dennis Kuczynski
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

[rspec-users] Issue when testing ActiveRecord after_commit callbacks

2012-06-28 Thread Dennis Kuczynski
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

Re: [rspec-users] Issue when testing ActiveRecord after_commit callbacks

2012-06-28 Thread David Chelimsky
On Thu, Jun 28, 2012 at 2:11 PM, Dennis Kuczynski dennis.kuczyn...@gmail.com 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Â