mastodon/spec/models
Claire e38fc319dc
Refactor and improve tests (#17386)
* Change account and user fabricators to simplify and improve tests

- `Fabricate(:account)` implicitly fabricates an associated `user` if
  no `domain` attribute is given (an account with `domain: nil` is
  considered a local account, but no user record was created), unless
  `user: nil` is passed
- `Fabricate(:account, user: Fabricate(:user))` should still be possible
  but is discouraged.

* Fix and refactor tests

- avoid passing unneeded attributes to `Fabricate(:user)` or
  `Fabricate(:account)`
- avoid embedding `Fabricate(:user)` into a `Fabricate(:account)` or the other
  way around
- prefer `Fabricate(:user, account_attributes: …)` to
  `Fabricate(:user, account: Fabricate(:account, …)`
- also, some tests were using remote accounts with local user records, which is
  not representative of production code.
2022-01-28 00:46:42 +01:00
..
admin
concerns
trends
web Add policy param to POST /api/v1/push/subscriptions (#16040) 2021-04-15 05:00:25 +02:00
account_alias_spec.rb
account_conversation_spec.rb
account_deletion_request_spec.rb
account_domain_block_spec.rb
account_filter_spec.rb
account_migration_spec.rb Add account migration UI (#11846) 2019-09-19 20:58:19 +02:00
account_moderation_note_spec.rb Lint pass (#8876) 2018-10-04 12:36:53 +02:00
account_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
account_statuses_cleanup_policy_spec.rb Allow keeping only 1 boosts/favs on auto deleting posts (#16653) 2021-10-14 21:11:14 +02:00
announcement_mute_spec.rb
announcement_reaction_spec.rb
announcement_spec.rb Add announcements (#12662) 2020-01-23 22:00:13 +01:00
backup_spec.rb Lint pass (#8876) 2018-10-04 12:36:53 +02:00
block_spec.rb Cover Block more (#3837) 2017-06-19 11:31:37 +02:00
canonical_email_block_spec.rb
conversation_mute_spec.rb
conversation_spec.rb Revert "Remove conversation URI (#11423)" (#11424) 2019-07-28 17:47:37 +02:00
custom_emoji_category_spec.rb
custom_emoji_filter_spec.rb
custom_emoji_spec.rb
custom_filter_spec.rb
device_spec.rb Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
domain_allow_spec.rb Add whitelist mode (#11291) 2019-07-30 11:10:46 +02:00
domain_block_spec.rb Allow blocking TLDs, and fix TLD blocks not being editable (#12805) 2020-01-08 22:42:05 +01:00
email_domain_block_spec.rb
encrypted_message_spec.rb
export_spec.rb Export and import show_reblogs together with following list (#10495) 2019-04-08 07:28:27 +02:00
favourite_spec.rb
featured_tag_spec.rb Add featured hashtags to profiles (#9755) 2019-02-04 04:25:59 +01:00
follow_recommendation_suppression_spec.rb
follow_request_spec.rb
follow_spec.rb Fix follow limit preventing re-following of a moved account (#14207) 2020-12-18 09:18:31 +01:00
home_feed_spec.rb Fix performance of home feed regeneration (#12084) 2019-10-06 22:11:17 +02:00
identity_spec.rb Add spec for Identity.find_for_oauth (#9441) 2018-12-06 17:38:49 +09:00
import_spec.rb
invite_spec.rb Change account suspensions to be reversible by default (#14726) 2020-09-15 14:37:58 +02:00
ip_block_spec.rb Add IP-based rules (#14963) 2020-10-12 16:33:49 +02:00
list_account_spec.rb Lint pass (#8876) 2018-10-04 12:36:53 +02:00
list_spec.rb Lint pass (#8876) 2018-10-04 12:36:53 +02:00
login_activity_spec.rb
marker_spec.rb
media_attachment_spec.rb Fix error when rendering public pages with media attachments (#16763) 2021-10-13 15:27:19 +02:00
mention_spec.rb add more tests to models 2017-04-05 00:29:56 +02:00
mute_spec.rb Lint pass (#8876) 2018-10-04 12:36:53 +02:00
notification_spec.rb
one_time_key_spec.rb Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
poll_spec.rb
poll_vote_spec.rb
preview_card_spec.rb Lint pass (#8876) 2018-10-04 12:36:53 +02:00
public_feed_spec.rb
relationship_filter_spec.rb
relay_spec.rb Add federation relay support (#7998) 2018-07-13 02:16:06 +02:00
remote_follow_spec.rb Fix uncaught domain normalization error in remote follow (#11703) 2019-08-30 02:19:17 +02:00
report_filter_spec.rb Add coverage for ReportFilter and AccountFilter (#3236) 2017-05-22 15:50:58 -04:00
report_spec.rb Add notifications for statuses deleted by moderators (#17204) 2022-01-17 09:41:33 +01:00
rule_spec.rb
scheduled_status_spec.rb Add scheduled statuses (#9706) 2019-01-05 12:43:28 +01:00
session_activation_spec.rb Add Ruby 3.0 support (#16046) 2021-05-06 14:22:54 +02:00
setting_spec.rb Update Mastodon to Rails 6.1 (#15910) 2021-03-24 10:44:31 +01:00
site_upload_spec.rb Add a test for SiteUpload#cache_key (#5685) 2017-11-14 20:44:11 +01:00
status_edit_spec.rb
status_pin_spec.rb
status_spec.rb
status_stat_spec.rb Extract counters from accounts table to account_stats table (#9295) 2018-11-19 00:43:52 +01:00
system_key_spec.rb Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
tag_feed_spec.rb Fix typo in tag_feed_spec.rb (#16466) 2021-07-05 19:16:21 +02:00
tag_spec.rb
unavailable_domain_spec.rb
user_invite_request_spec.rb Add "why do you want to join" field to invite requests (#10524) 2019-04-09 23:06:30 +09:00
user_spec.rb
webauthn_credentials_spec.rb