docbrown/spec
Jeremy Friesen d1069af35c
Adding ArticlePolicy#moderate? (#16786)
This commit does three things:

1) Adds and tests the ArticlePolicy#moderate? feature
2) Refactors the spec helpers to be a bit more flexible
3) Adds a few more edge case tests around ArticlePolicy

My apologies for conflating these changes, as it makes this commit
more challenging to review.

The goal is to adequate demonstrate the logic around users who can or
cannot moderate.  At present, the rules for who can moderate is here:

841491c6ee/app/javascript/packs/articleModerationTools.js (L17-L27)

```js
if (user?.trusted) {
   if (user?.id !== articleAuthorId && !isModerationPage()) {
     initializeActionsPanel(user, path);
     initializeFlagUserModal(articleAuthorId);
     // "/mod" page
   } else if (isModerationPage()) {
     initializeActionsPanel(user, path);
     initializeFlagUserModal(articleAuthorId);
   }
}
```

- Related to forem/forem#16783
- Closes forem/forem#16784
2022-03-07 15:27:43 -05:00
..
controllers/concerns
decorators Refactoring cached_followed_tags (#16175) 2022-01-24 19:53:48 -05:00
factories Require profile fields to belong to a group (#16390) 2022-02-15 09:27:18 -06:00
fixtures
forms
generator
helpers extra tweaks for i18n (#16192) 2022-02-23 06:48:52 -07:00
initializers A suspended user returns 403 instead of 500 (#16408) 2022-02-04 09:42:23 -05:00
lib Renaming method for clarity (#16791) 2022-03-07 12:55:56 -05:00
liquid_tags Implement Loom Embed (not merging now) (#16633) 2022-02-22 09:05:55 -05:00
mailers "Reply to" and "From" Email addresses for SMTP Configurations (#16499) 2022-02-16 16:14:54 +02:00
models Adding indirection for Tag#name to ease future work (#16703) 2022-02-28 16:32:04 -05:00
policies Adding ArticlePolicy#moderate? (#16786) 2022-03-07 15:27:43 -05:00
queries
refinements
requests Redirect appended /moderate and /admin to the same page (admin member view) (#16779) 2022-03-03 19:40:03 -05:00
routing Scoping the :listing routes to feature (#16406) 2022-02-04 10:13:56 -05:00
sanitizers Don't sanitize anchor elements with no href (#16667) 2022-02-22 11:27:38 -06:00
serializers
services Only fetch RSS of users who can create articles (#16766) 2022-03-04 14:06:38 -05:00
support Fix error in feed follow buttons where user name has apostrophe (#16758) 2022-03-02 15:53:48 -05:00
system Fix broken email settings documentation link (#16792) 2022-03-07 10:45:35 -06:00
tasks Make home link an admin-customisable navigation link (#16268) 2022-02-01 09:27:09 +00:00
uploaders Remove Remaining logo_svg Code (#16291) 2022-02-22 12:05:16 -07:00
validators
view_objects
views
workers Favoring User scope as parameter for feed fetching (#16763) 2022-03-02 16:45:06 -05:00
i18n_spec.rb Show missing translation keys when test fails (#16637) 2022-02-17 16:21:29 -06:00
rails_helper.rb Let's be friends again, Rubocop (#16294) 2022-01-25 11:58:00 -05:00
spec_helper.rb