Welcome to mirror list, hosted at ThFree Co, Russian Federation.

email_helpers.rb « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a85ab22ce36fc814a2f5603d8d5f528a484f46ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
module EmailHelpers
  def sent_to_user?(user)
    ActionMailer::Base.deliveries.map(&:to).flatten.count(user.email) == 1
  end

  def should_email(user)
    expect(sent_to_user?(user)).to be_truthy
  end

  def should_not_email(user)
    expect(sent_to_user?(user)).to be_falsey
  end
end