File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
spec/mailers/better_together Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 33require 'rails_helper'
44
55module BetterTogether
6- RSpec . describe ConversationMailer , type : :mailer do
7- describe 'new_message_notification' do
6+ RSpec . describe ConversationMailer , type : :mailer do # rubocop:todo Metrics/BlockLength
7+ describe 'new_message_notification' do # rubocop:todo Metrics/BlockLength
88 let! ( :host_platform ) { create ( :platform , :host ) }
99 let ( :sender ) { create ( :user ) }
1010 let ( :recipient ) { create ( :user ) }
@@ -27,6 +27,16 @@ module BetterTogether
2727 expect ( mail . body . encoded ) . to have_content ( "#{ sender . person . name } :" )
2828 expect ( mail . body . encoded ) . to have_content ( message . content . to_plain_text )
2929 end
30+
31+ it 'sends a message notification email' do
32+ expect { mail . deliver_now }
33+ . to change { ActionMailer ::Base . deliveries . count } . by ( 1 )
34+ end
35+
36+ it 'sends the message notification to the correct email address' do
37+ mail . deliver_now
38+ expect ( ActionMailer ::Base . deliveries . last . to ) . to include ( recipient . email )
39+ end
3040 end
3141 end
3242end
You can’t perform that action at this time.
0 commit comments