mailers on submission

This commit is contained in:
Mark Moser 2016-08-02 11:57:52 -05:00
parent 54189603f0
commit 8e27fb8e01
2 changed files with 13 additions and 0 deletions

View File

@ -41,6 +41,11 @@ class CandidateController < ApplicationController
# TODO # TODO
def update_summary def update_summary
# redirect_to :summary # redirect_to :summary
# only after successful submission
CandidateMailer.submitted(current_candidate).deliver_now
RecruiterMailer.candidate_submitted(current_candidate).deliver_now
ReviewerMailer.candidate_submission(current_candidate).deliver_now
end end
def validate def validate

View File

@ -56,4 +56,12 @@ class CandidateControllerTest < ActionDispatch::IntegrationTest
assert session[:test_id].present? assert session[:test_id].present?
assert_equal qid, flash[:answer_error] assert_equal qid, flash[:answer_error]
end end
test "should send mailers on submission" do
setup_auth candidates(:dawn)
assert_difference("ActionMailer::Base.deliveries.size", 3) do
post post_summary_path
end
end
end end