docbrown/app
Jeremy Friesen 91b951eb05
Refactoring and extending article spam behavior (#15399)
* Refactoring and extending article spam behavior

Prior to this refactor, we were checking an Article's title for
spaminess.  This change now checks the Article's title and
body_markdown.

In addition, the encapsulates the regular expression implementations in
favor of asking the Settings::RateLimit class to determine if the passed
in text is "spammy".

Furthermore, instead of having lots of inline logic within the article,
this refactor introduces a `Spam::ArticleHandler` class.  This helps
tidy up the already busy Article specs by delegating the business logic
of Spam handling to it's own class.

There are further refactors for Comments and Users that would follow
this pattern, but this change is more important to get out the door.

Closes #15396

* Adding comments to clarify behavior of spam handling

* Adding missing expectation to spec
2021-11-17 17:09:17 -05:00
..
assets Remove Setup Banner from Creator Onboarding Flow (#15310) 2021-11-17 13:20:16 -07:00
black_box Make Rubocop happy again (#14729) 2021-09-14 09:15:01 -05:00
components/admin/users Small change to make the tools section of member details mobile friendly. (#15159) 2021-10-22 18:47:20 +02:00
controllers Adding ability to block domains from registration (#15397) 2021-11-16 18:56:01 -05:00
decorators Theming cleanup (#15237) 2021-11-09 10:11:55 -05:00
errors When a user is blocked from commenting on an article, show correct error message (#15009) 2021-10-14 07:42:08 -06:00
helpers Remove unused assets (#15367) 2021-11-16 19:57:37 +01:00
javascript Fixed issue where element didn't exist in the config Stimulus controller. (#15408) 2021-11-17 15:25:17 -05:00
lib Adding ability to block domains from registration (#15397) 2021-11-16 18:56:01 -05:00
liquid_tags Remove redundant freeze calls (#14596) 2021-08-26 10:01:08 -04:00
mailers Re-add dynamic delivery_method for ApplicationMailer (#13994) 2021-06-23 15:17:27 -04:00
models Refactoring and extending article spam behavior (#15399) 2021-11-17 17:09:17 -05:00
policies When a user is blocked from commenting on an article, show correct error message (#15009) 2021-10-14 07:42:08 -06:00
queries Adds validations to avoid creating unnecessary PNs (#14621) 2021-08-31 15:00:30 -06:00
refinements Drop profile columns from user (#10707) 2020-12-03 08:14:38 +07:00
sanitizers Remove redundant freeze calls (#14596) 2021-08-26 10:01:08 -04:00
serializers Remove duplicated work display from header / profile work (#14210) 2021-07-30 12:28:40 +02:00
services Refactoring and extending article spam behavior (#15399) 2021-11-17 17:09:17 -05:00
uploaders ✂✂✂ Remove events (#15062) 2021-10-15 09:31:08 -04:00
validators Remove redundant freeze calls (#14596) 2021-08-26 10:01:08 -04:00
view_objects Upgrade to Ruby 3.0.2 (#12103) 2021-08-25 14:26:33 -04:00
views Remove Setup Banner from Creator Onboarding Flow (#15310) 2021-11-17 13:20:16 -07:00
workers Add PGHero for more insights into the DB (#15073) 2021-11-05 12:25:02 -04:00