mercredi 3 mars 2021

Check if line got executed with Rspec

I have a worker that sends email to users when new feedback pops in. I wanted to allow user to not agree to that (with Shih Tzu flags). Question is: how can I test (with Rspec) if the FedbackMailer.new_feedback line gets executed?

  account.users.each do |user|
    return if (user.no_notifications || user.just_summary)

    FeedbackMailer.new_feedback(account.id, feedback_id, user.id).deliver_later
  end

Aucun commentaire:

Enregistrer un commentaire