Submit summary

This commit is contained in:
Derek Montgomery
2016-08-02 16:27:27 -05:00
parent 988f1346c1
commit 7bdb86f89f
6 changed files with 135 additions and 14 deletions

View File

@ -57,11 +57,22 @@ class CandidateControllerTest < ActionDispatch::IntegrationTest
assert_equal qid, flash[:answer_error]
end
test "should send mailers on submission" do
test "should NOT send mailers on submission" do
setup_auth candidates(:dawn)
assert_difference("ActionMailer::Base.deliveries.size", 0) do
post post_summary_path
end
assert_redirected_to summary_path
assert_match 'must complete', flash[:error]
end
test "should send mailers on submission" do
setup_auth candidates(:peggy)
assert_difference("ActionMailer::Base.deliveries.size", 3) do
post post_summary_path
end
assert_redirected_to thankyou_path
end
end