FIX: Don't enqueue imported users when there're multiple custom fields. (#11559)

My initial implementation didn't consider this case. We should skip imported users if the "imported_id" field is present, even if there're other custom fields.
This commit is contained in:
Roman Rizzi
2020-12-22 14:28:07 -03:00
committed by GitHub
parent a4fb28ccd8
commit 8a7fe3b276
2 changed files with 18 additions and 3 deletions

View File

@@ -80,5 +80,13 @@ describe Jobs::EnqueueSuspectUsers do
expect(ReviewableUser.where(target: suspect_user).exists?).to eq(true)
end
it 'ignores imported users even if they have multiple custom fields' do
suspect_user.upsert_custom_fields({ field_a: 'value', field_b: 'value', import_id: 'fake_id' })
subject.execute({})
expect(ReviewableUser.where(target: suspect_user).exists?).to eq(false)
end
end
end