🖥
#Rails ActionMailer + #Rspec でメール送信数 / 送信先をテストする例
subject { something }
it do
expect { subject }.to change { ActionMailer::Base.deliveries.count }.by(3)
end
before { subject }
it do
expect(ActionMailer::Base.deliveries.map(&:to)).to include ['alice@example.com']
expect(ActionMailer::Base.deliveries.map(&:to)).to include ['bob@example.com', 'carol@example.com']
end
Original by Github issue
チャットメンバー募集
何か質問、悩み事、相談などあればLINEオープンチャットもご利用ください。
公開日時
2020-01-14
Discussion