reminders in play!

This commit is contained in:
Mark Moser
2016-08-02 15:25:55 -05:00
parent 9ac58773df
commit d5052644c2
4 changed files with 74 additions and 4 deletions

View File

@@ -0,0 +1,26 @@
require 'test_helper'
class ReminderTest < ActiveSupport::TestCase
test "collection is created with one result" do
reminders = Reminder.new
assert_equal 1, reminders.size
end
test "each candidate has needed attributes" do
reminders = Reminder.new
assert_instance_of String, reminders.candidates.first.name
assert_instance_of String, reminders.candidates.first.test_hash
assert_instance_of String, reminders.candidates.first.email
end
test "send reminders sends email, and flags reminded" do
reminders = Reminder.new
pre_reminded = Candidate.find(reminders.candidates.first.id).reminded
assert_difference("ActionMailer::Base.deliveries.size", reminders.count) do
reminders.send_all
end
refute_equal pre_reminded, Candidate.find(reminders.candidates.first.id).reminded
end
end