diff --git a/app/workers/reminder.rb b/app/workers/candidate_reminder.rb similarity index 97% rename from app/workers/reminder.rb rename to app/workers/candidate_reminder.rb index 7437f04..a804e8e 100644 --- a/app/workers/reminder.rb +++ b/app/workers/candidate_reminder.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -class Reminder +class CandidateReminder def initialize @collection = reminder_collection end diff --git a/lib/tasks/reminders.rake b/lib/tasks/reminders.rake index 2695aa6..086a570 100644 --- a/lib/tasks/reminders.rake +++ b/lib/tasks/reminders.rake @@ -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 diff --git a/test/workers/reminder_test.rb b/test/workers/candidate_reminder_test.rb similarity index 81% rename from test/workers/reminder_test.rb rename to test/workers/candidate_reminder_test.rb index 32dabbb..fbe83a5 100644 --- a/test/workers/reminder_test.rb +++ b/test/workers/candidate_reminder_test.rb @@ -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