File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ def create
77 @answer = Answer . create params [ :answer ]
88 @answer . question = @question
99 @answer . user = current_user
10+
11+ Notification . new_answer ( @question ) . deliver
12+
1013 create! ( :notice => "Answer Posted!" ) { question_url ( params [ :question_id ] ) }
1114 end
1215
Original file line number Diff line number Diff line change 5757 :authentication => :plain ,
5858 :user_name => ENV [ 'SENDGRID_USERNAME' ] ,
5959 :password => ENV [ 'SENDGRID_PASSWORD' ] ,
60- :domain => 'hackety-hack .com'
60+ :domain => 'hackety.com'
6161}
6262ActionMailer ::Base . delivery_method = :smtp
6363
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ Feature: CRUD actions for answers
66 Given a question exists
77 And I answer that question
88 Then I should be notified that my answer was submitted
9+ And an email should be sent to the author
910 And I should be able to see my answer
1011 And my answer should show on my profile page
1112
Original file line number Diff line number Diff line change 2323 page . should have_content ( @question . title )
2424 page . should have_content ( "Have you tried turning it off and on again?" )
2525end
26+
27+ Then /^an email should be sent to the author$/ do
28+ ActionMailer ::Base . deliveries . should_not be_empty
29+ end
30+
Original file line number Diff line number Diff line change 1+ Before do
2+ ActionMailer ::Base . deliveries . clear
3+ end
You can’t perform that action at this time.
0 commit comments