2017-02-08 17:34:05 -06:00
|
|
|
# frozen_string_literal: true
|
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class ReviewerReminderTest < ActiveSupport::TestCase
|
2017-02-09 16:27:00 -06:00
|
|
|
test "collection is created with results" do
|
2017-02-08 17:34:05 -06:00
|
|
|
reminders = ReviewerReminder.new
|
2017-02-09 16:27:00 -06:00
|
|
|
assert_equal 6, reminders.size
|
2017-02-08 17:34:05 -06:00
|
|
|
end
|
|
|
|
|
|
|
|
test "each reminder has needed attributes" do
|
|
|
|
collection = ReviewerReminder.new
|
|
|
|
|
|
|
|
assert_instance_of String, collection.reminders.first.name
|
|
|
|
assert_instance_of String, collection.reminders.first.email
|
|
|
|
assert_instance_of String, collection.reminders.first.test_hash
|
|
|
|
end
|
|
|
|
|
|
|
|
test "send_all sends emails for each reviewer and test" do
|
|
|
|
collection = ReviewerReminder.new
|
|
|
|
|
|
|
|
assert_difference("ActionMailer::Base.deliveries.size", collection.count) do
|
|
|
|
collection.send_all
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|