docbrown/spec
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
..
black_box Remove <provider>_created_at columns (#13264) 2021-04-29 10:24:16 -05:00
components/admin/users Refactor Admin Member Detail view - Tools section (#14283) 2021-08-17 18:55:53 +02:00
controllers/concerns 15 minute fix: Add default argument to JsonApiSortParam (#13369) 2021-04-14 10:32:07 +07:00
decorators Theming cleanup (#15237) 2021-11-09 10:11:55 -05:00
factories Theming cleanup (#15237) 2021-11-09 10:11:55 -05:00
fixtures Remove duplicated work display from header / profile work (#14210) 2021-07-30 12:28:40 +02:00
generator Add service generator (#11265) 2020-11-10 09:09:35 +07:00
helpers Remove unused assets (#15367) 2021-11-16 19:57:37 +01:00
initializers Clean up feed-related code (#14707) 2021-09-17 09:23:32 +07:00
lib Nullify invalid tag colors (#15361) 2021-11-12 14:35:08 -06:00
liquid_tags Rubocop fixes (#14868) 2021-09-30 13:22:09 -04:00
mailers Created the Forem creator confirmation email template (#14659) 2021-10-21 14:56:09 -04:00
models Refactoring and extending article spam behavior (#15399) 2021-11-17 17:09:17 -05:00
policies Fix organization's admin unable to view an article's stats (#14767) 2021-09-21 16:05:34 +01:00
queries Adds validations to avoid creating unnecessary PNs (#14621) 2021-08-31 15:00:30 -06:00
refinements Update data exporter to handle admin send (#10274) 2020-10-26 18:00:56 -04:00
requests Remove name from allowed tag params in admin (#15382) 2021-11-15 14:58:24 -06:00
routing ✂✂✂ Remove shop_url from SiteConfig ✂✂✂ (#13773) 2021-05-18 09:03:05 +07:00
serializers/search Cleanup search classes and serializers (#13645) 2021-05-05 09:20:59 -04:00
services Refactoring and extending article spam behavior (#15399) 2021-11-17 17:09:17 -05:00
support Bug Fix: Following an organization from article's sidebar creates an incorrect follow record (#15093) 2021-11-05 12:40:20 -04:00
system Update tag's style (#15266) 2021-11-11 14:03:31 -05:00
tasks Create Default Nav Links In New Forem (RFC #237) (#14345) 2021-08-02 12:52:36 -04:00
uploaders ✂✂✂ Remove events (#15062) 2021-10-15 09:31:08 -04:00
view_objects [15 min fix] Fallback to the image URL if Cloudinary/Imgproxy are not configured (#13767) 2021-05-19 15:03:20 +02:00
views Let users purchase credits (#15346) 2021-11-10 15:18:52 -06:00
workers Asynchronously detect image aspect ratios and apply proper attributes (#15170) 2021-10-26 13:39:25 -07:00
i18n_spec.rb Misc i18n fixes (#14852) 2021-10-05 13:22:33 +02:00
rails_helper.rb Add feature flag for Connect (#14644) 2021-09-13 10:45:56 -04:00
spec_helper.rb Theme data update script, remove theme choices from UI (#15225) 2021-11-08 08:38:43 -05:00