mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: don't send repeated notifications that there are pending users who need to be approved to moderators who haven't read the previous notification
This commit is contained in:
@@ -9,13 +9,15 @@ describe Jobs::PendingUsersReminder do
|
||||
|
||||
it "doesn't send a message to anyone when there are no pending users" do
|
||||
AdminUserIndexQuery.any_instance.stubs(:find_users_query).returns(stub_everything(count: 0))
|
||||
GroupMessage.any_instance.expects(:create).never
|
||||
PostCreator.expects(:create).never
|
||||
Jobs::PendingUsersReminder.new.execute({})
|
||||
end
|
||||
|
||||
it "sends a message to moderators when there are pending users" do
|
||||
it "sends a message when there are pending users" do
|
||||
Fabricate(:moderator)
|
||||
Group.refresh_automatic_group!(:moderators)
|
||||
AdminUserIndexQuery.any_instance.stubs(:find_users_query).returns(stub_everything(count: 1))
|
||||
GroupMessage.expects(:create).with(Group[:moderators].name, :pending_users_reminder, anything)
|
||||
PostCreator.expects(:create).once
|
||||
Jobs::PendingUsersReminder.new.execute({})
|
||||
end
|
||||
end
|
||||
@@ -27,7 +29,7 @@ describe Jobs::PendingUsersReminder do
|
||||
|
||||
it "doesn't send a message to anyone when there are pending users" do
|
||||
AdminUserIndexQuery.any_instance.stubs(:find_users_query).returns(stub_everything(count: 1))
|
||||
GroupMessage.any_instance.expects(:create).never
|
||||
PostCreator.expects(:create).never
|
||||
Jobs::PendingUsersReminder.new.execute({})
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user