docbrown/spec/services
Daniel Uber 421dad2900
Remove reactions to a user when deleting the user (#15724)
* Remove reactions to a user when deleting the user

Fixes #15245

---

I have no idea why `create(:vomit_reaction, reactable: user)` gave a
validation error about category being invalid, but `build().save`
worked fine.

* Move relation details to reaction scope `for_user`

Add a user method to access this by passing self to reaction scope

* Create a moderator when flagging user in factory

This might be a missing requirement in the reactions factory - but
this suppresses an error about invalid category I was getting when
setting a privileged reaction on the user via

    create(:vomit_reaction, reactable: user)

Everywhere else it looks like we do this with `user: moderator` (where
there's a trusted user in the surrounding context).

* Move trusted user requirement into vomit_reaction factory

* Add a data update script to remove reactions to deleted users

This cleans up the remaining invalid references and should make the
change in #15249 obsolete (i.e. we don't need to limit the view to
exclude items that no longer exist).
2021-12-10 11:24:23 -06:00
..
articles Spelling (#15702) 2021-12-07 06:59:10 -07:00
audit
authentication Spelling (#15702) 2021-12-07 06:59:10 -07:00
badges Skip badge awards for spam accounts (#15344) 2021-11-10 10:48:01 -06:00
broadcasts/welcome_notification Forem passport (cont) (#14759) 2021-09-30 06:47:45 -06:00
color Spelling (#15702) 2021-12-07 06:59:10 -07:00
credits
discover Add Forem Discover registration worker and service (#14865) 2021-10-01 10:27:31 -04:00
edge_cache ✂✂✂ Remove events (#15062) 2021-10-15 09:31:08 -04:00
exporter Create Settings::SMTP (#13943) 2021-06-14 10:29:43 -04:00
fastly_config Abstract DatadogStatsClient to ForemStatsClient (#12304) 2021-01-27 11:25:44 -05:00
feeds Use the rss item's url when handling relative image links (#15497) 2021-12-09 14:08:54 -06:00
follows
giphy
github
homepage Serialize tag flares correctly in Homepage::ArticleSerializer (#13537) 2021-04-27 16:07:05 +02:00
html Rubocop fixes (#14868) 2021-09-30 13:22:09 -04:00
images Fix rotation of images uploaded from iPhones (#15010) 2021-10-11 15:17:14 -04:00
loggers
mailchimp Handle GibbonError when Mailchimp api key was not set (#14695) 2021-09-13 10:30:35 -05:00
markdown_processor Remove button from allowed tags (#14434) 2021-08-11 10:48:07 -04:00
mentions Issue #9077 has already been resolved, added specs (#15342) 2021-11-17 11:27:50 +02:00
moderator Replacing User#warned with User#warned? (#15628) 2021-12-01 13:14:16 -05:00
notification_subscriptions Add Article post_commit when user_id changes with specs (#15132) 2021-10-25 10:53:21 +07:00
notifications Don't notify authors about own org posts (#15113) 2021-10-19 21:32:44 +07:00
organizations Organizations delete optimizations and refactoring (#13610) 2021-05-11 12:14:55 +03:00
payments Validate payment info present before attempting to process (#15629) 2021-12-03 13:09:23 -06:00
podcasts Spelling (#15702) 2021-12-07 06:59:10 -07:00
profile_fields Remove check_box type from profile fields (#14832) 2021-09-30 13:27:39 -04:00
push_notifications Fix Rpush app when creating Android notification (#15529) 2021-11-30 10:05:40 +05:30
re_captcha Spelling (#15702) 2021-12-07 06:59:10 -07:00
search Ensuring reading list excludes unpublished articles (#15490) 2021-11-24 13:22:26 -05:00
secrets
settings/authentication Disable all providers when providers_to_enable param is blank (#15260) 2021-11-02 21:20:26 -04:00
slack Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
spam Refactoring Spam Handler (#15412) 2021-11-30 12:45:12 -05:00
tag_moderators ✂✂✂ Remove Connect (#14734) 2021-11-18 08:21:00 -06:00
twitter_client Rename SiteConfig to Settings::General (#13573) 2021-05-21 14:45:37 +02:00
user_subscriptions
users Remove reactions to a user when deleting the user (#15724) 2021-12-10 11:24:23 -06:00
webhook
analytics_service_spec.rb Add counts for number of views when showing referrers (#14600) 2021-08-27 08:03:43 -05:00
article_with_video_creation_service_spec.rb Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121) 2021-07-08 09:31:34 -05:00
bulk_sql_delete_spec.rb
email_digest_article_collector_spec.rb Don't include "anti-followed" tags in email digest (#14782) 2021-09-30 10:44:38 +07:00
email_digest_spec.rb Use new UserSetting and UserNotificationSettings and Ignore Related User Table Fields (#14121) 2021-07-08 09:31:34 -05:00
feature_flag_spec.rb
flare_tag_spec.rb
medium_article_retrieval_service_spec.rb
rate_limit_checker_spec.rb Pin posts to feed (#13807) 2021-06-04 10:54:53 +02:00
tag_adjustment_creation_service_spec.rb
tag_adjustment_update_service_spec.rb