reminder name refactor
This commit is contained in:
parent
58d3fbd7c2
commit
5f3dfb5c96
@ -1,5 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
class Reminder
|
||||
class CandidateReminder
|
||||
def initialize
|
||||
@collection = reminder_collection
|
||||
end
|
@ -2,7 +2,7 @@
|
||||
namespace :reminders do
|
||||
desc "send reminders to stagnate quizes"
|
||||
task send_all: :environment do
|
||||
reminders = Reminder.new
|
||||
reminders = CandidateReminder.new
|
||||
reminders.send_all
|
||||
end
|
||||
end
|
||||
|
@ -1,14 +1,14 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test_helper'
|
||||
|
||||
class ReminderTest < ActiveSupport::TestCase
|
||||
class CandidateReminderTest < ActiveSupport::TestCase
|
||||
test "collection is created with one result" do
|
||||
reminders = Reminder.new
|
||||
reminders = CandidateReminder.new
|
||||
assert_equal 1, reminders.size
|
||||
end
|
||||
|
||||
test "each candidate has needed attributes" do
|
||||
reminders = Reminder.new
|
||||
reminders = CandidateReminder.new
|
||||
|
||||
assert_instance_of String, reminders.candidates.first.name
|
||||
assert_instance_of String, reminders.candidates.first.test_hash
|
||||
@ -16,7 +16,7 @@ class ReminderTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "send reminders sends email, and flags reminded" do
|
||||
reminders = Reminder.new
|
||||
reminders = CandidateReminder.new
|
||||
pre_reminded = Candidate.find(reminders.candidates.first.id).reminded
|
||||
|
||||
assert_difference("ActionMailer::Base.deliveries.size", reminders.count) do
|
Loading…
Reference in New Issue
Block a user