First pass coverage addition for antispam class (#35771)
This commit is contained in:
parent
1675eab561
commit
7a862d3308
2 changed files with 57 additions and 2 deletions
|
|
@ -57,8 +57,16 @@ class Antispam
|
|||
end
|
||||
|
||||
def report_if_needed!(account)
|
||||
return if Report.unresolved.exists?(account: Account.representative, target_account: account)
|
||||
return if system_reports.unresolved.exists?(target_account: account)
|
||||
|
||||
Report.create!(account: Account.representative, target_account: account, category: :spam, comment: 'Account automatically reported for posting a banned URL')
|
||||
system_reports.create!(
|
||||
category: :spam,
|
||||
comment: 'Account automatically reported for posting a banned URL',
|
||||
target_account: account
|
||||
)
|
||||
end
|
||||
|
||||
def system_reports
|
||||
Account.representative.reports
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue