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 Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
concerns Add remove from followers api (#16864) 2021-10-18 12:02:35 +02:00
trends Add trending links (#16917) 2021-11-25 13:07:38 +01:00
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 Change account suspensions to be reversible by default (#14726) 2020-09-15 14:37:58 +02:00
account_domain_block_spec.rb
account_filter_spec.rb Add batch suspend for accounts in admin UI (#17009) 2021-12-05 21:48:39 +01:00
account_migration_spec.rb
account_moderation_note_spec.rb
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
backup_spec.rb
block_spec.rb
canonical_email_block_spec.rb Add canonical e-mail blocks for suspended accounts (#16049) 2021-04-17 03:14:25 +02:00
conversation_mute_spec.rb
conversation_spec.rb
custom_emoji_category_spec.rb
custom_emoji_filter_spec.rb
custom_emoji_spec.rb
custom_filter_spec.rb
device_spec.rb
domain_allow_spec.rb
domain_block_spec.rb
email_domain_block_spec.rb
encrypted_message_spec.rb
export_spec.rb
favourite_spec.rb
featured_tag_spec.rb
follow_recommendation_suppression_spec.rb Add cold-start follow recommendations (#15945) 2021-04-12 12:37:14 +02:00
follow_request_spec.rb Fix edge case where accepted follow cannot be processed because of follow limit (#16098) 2021-04-23 22:51:21 +02:00
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
identity_spec.rb
import_spec.rb Fix follow limit preventing re-following of a moved account (#14207) 2020-12-18 09:18:31 +01:00
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
list_spec.rb
login_activity_spec.rb Add authentication history (#16408) 2021-06-21 17:07:30 +02:00
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
mute_spec.rb
notification_spec.rb Improved performance of notification preloading (#15640) 2021-01-31 21:24:57 +01:00
one_time_key_spec.rb
poll_spec.rb
poll_vote_spec.rb
preview_card_spec.rb
public_feed_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
relationship_filter_spec.rb
relay_spec.rb
remote_follow_spec.rb
report_filter_spec.rb
report_spec.rb Add notifications for statuses deleted by moderators (#17204) 2022-01-17 09:41:33 +01:00
rule_spec.rb Add server rules (#15769) 2021-02-21 19:50:12 +01:00
scheduled_status_spec.rb
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
status_edit_spec.rb Add support for editing for published statuses (#16697) 2022-01-19 22:37:27 +01:00
status_pin_spec.rb Add support for private pinned posts (#16954) 2022-01-17 00:49:55 +01:00
status_spec.rb Fix error-prone SQL queries (#15828) 2022-01-23 18:10:10 +01:00
status_stat_spec.rb
system_key_spec.rb
tag_feed_spec.rb Fix typo in tag_feed_spec.rb (#16466) 2021-07-05 19:16:21 +02:00
tag_spec.rb Improve tag search query (#16104) 2021-04-25 06:33:28 +02:00
unavailable_domain_spec.rb
user_invite_request_spec.rb
user_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
webauthn_credentials_spec.rb Fix validates :sign_count of WebauthnCredential (#14806) 2020-09-16 20:16:46 +02:00