diff --git a/app/workers/reviewer_reminder.rb b/app/workers/reviewer_reminder.rb index 7e67da6..26799de 100644 --- a/app/workers/reviewer_reminder.rb +++ b/app/workers/reviewer_reminder.rb @@ -26,7 +26,7 @@ class ReviewerReminder from reviewer_votes rev inner join users u on u.id = rev.user_id inner join candidates c on c.id = rev.candidate_id - where rev.vote = 0 and rev.veto = 0 + where rev.vote = 0 and c.review_status = 0 and u.role != 'manager' and u.active is not false;" ActiveRecord::Base.connection.exec_query(sql) end diff --git a/test/fixtures/candidates.yml b/test/fixtures/candidates.yml index 0e70cec..013b7a8 100644 --- a/test/fixtures/candidates.yml +++ b/test/fixtures/candidates.yml @@ -137,6 +137,7 @@ wade: # Wade has completed AND submitted the test completed_at: <%= DateTime.current - 8.days %> reminded: false test_hash: BkSkpapJnkz2N + review_status: 2 jorge: # Jorge has completed AND submitted the test name: Jorge Holmes diff --git a/test/workers/reviewer_reminder_test.rb b/test/workers/reviewer_reminder_test.rb index 5a6cbf0..23e83f2 100644 --- a/test/workers/reviewer_reminder_test.rb +++ b/test/workers/reviewer_reminder_test.rb @@ -4,7 +4,7 @@ require 'test_helper' class ReviewerReminderTest < ActiveSupport::TestCase test "collection is created with results" do reminders = ReviewerReminder.new - assert_equal 8, reminders.size + assert_equal 7, reminders.size end test "each reminder has needed attributes" do