mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: When must_approve_users is enabled, we don't want to send suspect users to the review queue. Only non-approved users should be sent. Provide a migration to auto-approve every problematic review item (#9179)
This commit is contained in:
@@ -39,5 +39,22 @@ describe Jobs::EnqueueSuspectUsers do
|
||||
|
||||
expect(score.reason).to eq('suspect_user')
|
||||
end
|
||||
|
||||
it 'only enqueues non-approved users' do
|
||||
suspect_user.update!(approved: true)
|
||||
|
||||
subject.execute({})
|
||||
|
||||
expect(ReviewableUser.where(target: suspect_user).exists?).to eq(false)
|
||||
end
|
||||
|
||||
it 'does nothing if must_approve_users is set to true' do
|
||||
SiteSetting.must_approve_users = true
|
||||
suspect_user.update!(approved: false)
|
||||
|
||||
subject.execute({})
|
||||
|
||||
expect(ReviewableUser.where(target: suspect_user).exists?).to eq(false)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user