voting requires a comment - completes #102

This commit is contained in:
Mark Moser
2017-02-27 13:41:46 -06:00
parent 538190b6bf
commit 3f41773c76
11 changed files with 84 additions and 18 deletions

View File

@ -40,6 +40,19 @@ module Admin
assert flash[:success]
end
test "admin can post comment" do
auth_admin
candidate = candidates(:stacy)
assert_difference("QuizComment.count") do
post admin_create_comment_url(test_hash: candidate.test_hash),
params: { quiz_comment: { message: 'this is an admin comment' } }
end
assert_redirected_to admin_result_url(test_hash: candidate.test_hash)
assert flash[:success]
end
test "should queue emails on create" do
auth_reviewer
candidate = candidates(:stacy)