0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

#Rails + #rspec でメール送信数をテストする

0
Last updated at Posted at 2019-10-27
  • change 記法で deliveries.count が増えたことを検証すれば良さげ。
  • expect(SomeMailer.deliveries.count).to eq 1 とか書いてしまうと、exampleごとにメール送信数をクリーンする処理を rails_helper に書く必要がありそう。
 expect { subject }.to change { SomeMailer.deliveries.count }.by(1)

ruby on rails 3 - How to test with Rspec if an email is delivered - Stack Overflow

Original by Github issue

チャットメンバー募集

何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。

Twitter

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?