sends emails to all reviewers on new comment

This commit is contained in:
Mark Moser
2017-02-14 11:32:39 -06:00
parent a8c42af3de
commit 2424fa021f
8 changed files with 60 additions and 1 deletions

View File

@ -3,6 +3,8 @@ require 'test_helper'
module Admin
class CommentControllerTest < ActionDispatch::IntegrationTest
include ActiveJob::TestHelper
test "should post update" do
auth_manager
comment = quiz_comments(:com5)
@ -38,6 +40,18 @@ module Admin
assert flash[:success]
end
test "should queue emails on create" do
auth_reviewer
candidate = candidates(:stacy)
assert_enqueued_jobs 1 do
assert_difference("QuizComment.count", 1) do
post admin_create_comment_url(test_hash: candidate.test_hash),
params: { quiz_comment: { message: 'this is a test comment' } }
end
end
end
test "should require comment to create" do
auth_reviewer
candidate = candidates(:stacy)