mailers on submission
This commit is contained in:
parent
54189603f0
commit
8e27fb8e01
@ -41,6 +41,11 @@ class CandidateController < ApplicationController
|
||||
# TODO
|
||||
def update_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
|
||||
|
||||
def validate
|
||||
|
@ -56,4 +56,12 @@ class CandidateControllerTest < ActionDispatch::IntegrationTest
|
||||
assert session[:test_id].present?
|
||||
assert_equal qid, flash[:answer_error]
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user