Skip to content

Instantly share code, notes, and snippets.

@amitpatelx
Created September 27, 2017 10:31
Show Gist options
  • Save amitpatelx/90271cf5f2957618e02ee3cbfce417a1 to your computer and use it in GitHub Desktop.
Save amitpatelx/90271cf5f2957618e02ee3cbfce417a1 to your computer and use it in GitHub Desktop.
Check if mail is queued for delivery in rspec
mailer_jobs_count = ActionMailer::DeliveryJob.queue_adapter.enqueued_jobs.count{ |x| x[:job] == ActionMailer::DeliveryJob && x[:args].last == feed.id}
expect(mailer_jobs_count).to eq 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment