From 5f3dfb5c96691c364a056b138927f207f1c22234 Mon Sep 17 00:00:00 2001 From: Mark Moser Date: Wed, 8 Feb 2017 16:30:54 -0600 Subject: [PATCH] reminder name refactor --- app/workers/{reminder.rb => candidate_reminder.rb} | 2 +- lib/tasks/reminders.rake | 2 +- .../{reminder_test.rb => candidate_reminder_test.rb} | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) rename app/workers/{reminder.rb => candidate_reminder.rb} (97%) rename test/workers/{reminder_test.rb => candidate_reminder_test.rb} (81%) 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