mastodon/spec/fabricators
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
..
assets
access_token_fabricator.rb
accessible_access_token_fabricator.rb
account_alias_fabricator.rb Add account migration UI (#11846) 2019-09-19 20:58:19 +02:00
account_deletion_request_fabricator.rb Change account suspensions to be reversible by default (#14726) 2020-09-15 14:37:58 +02:00
account_domain_block_fabricator.rb
account_fabricator.rb
account_migration_fabricator.rb
account_moderation_note_fabricator.rb Add moderation note (#5240) 2017-10-07 20:26:43 +02:00
account_note_fabricator.rb
account_pin_fabricator.rb
account_stat_fabricator.rb
account_statuses_cleanup_policy_fabricator.rb
account_tag_stat_fabricator.rb Add profile directory (#9427) 2018-12-06 17:36:11 +01:00
account_warning_fabricator.rb Add moderation warnings (#9519) 2018-12-22 20:02:09 +01:00
account_warning_preset_fabricator.rb
admin_action_log_fabricator.rb
announcement_fabricator.rb
announcement_mute_fabricator.rb
announcement_reaction_fabricator.rb
application_fabricator.rb
backup_fabricator.rb
block_fabricator.rb
bookmark_fabricator.rb
canonical_email_block_fabricator.rb
conversation_account_fabricator.rb
conversation_fabricator.rb Add conversation model, <ostatus:conversation /> (#3016) 2017-05-12 19:09:21 +02:00
conversation_mute_fabricator.rb Feature conversations muting (#3017) 2017-05-15 03:04:13 +02:00
custom_emoji_category_fabricator.rb
custom_emoji_fabricator.rb
custom_filter_fabricator.rb Keyword/phrase filtering (#7905) 2018-06-29 15:34:36 +02:00
device_fabricator.rb
domain_allow_fabricator.rb
domain_block_fabricator.rb Cover Admin::DomainBlocksController more (#3329) 2017-06-25 21:42:36 +02:00
email_domain_block_fabricator.rb Implement EmailBlackList (#5109) 2017-10-04 15:16:10 +02:00
encrypted_message_fabricator.rb
favourite_fabricator.rb
featured_tag_fabricator.rb
follow_fabricator.rb
follow_recommendation_suppression_fabricator.rb Add cold-start follow recommendations (#15945) 2021-04-12 12:37:14 +02:00
follow_request_fabricator.rb Remove redundant code in AtomSerializer and spec (#3528) 2017-06-03 20:51:08 +02:00
identity_fabricator.rb
import_fabricator.rb
invite_fabricator.rb
ip_block_fabricator.rb
list_account_fabricator.rb
list_fabricator.rb Lint pass (#8876) 2018-10-04 12:36:53 +02:00
login_activity_fabricator.rb
marker_fabricator.rb
media_attachment_fabricator.rb
mention_fabricator.rb
mute_fabricator.rb
notification_fabricator.rb Change columns in notifications nonnullable (#6764) 2018-03-24 12:51:28 +01:00
one_time_key_fabricator.rb
poll_fabricator.rb
poll_vote_fabricator.rb Add polls (#10111) 2019-03-03 22:18:23 +01:00
preview_card_fabricator.rb
relay_fabricator.rb
report_fabricator.rb
report_note_fabricator.rb Add tests for report notes controller (#7589) 2018-05-22 14:45:10 +02:00
rule_fabricator.rb Add server rules (#15769) 2021-02-21 19:50:12 +01:00
scheduled_status_fabricator.rb Add scheduled statuses (#9706) 2019-01-05 12:43:28 +01:00
session_activation_fabricator.rb
setting_fabricator.rb Add tests for Setting (#5683) 2017-11-14 11:08:04 +09:00
site_upload_fabricator.rb
status_edit_fabricator.rb Add support for editing for published statuses (#16697) 2022-01-19 22:37:27 +01:00
status_fabricator.rb Switch to static URIs, new URI format in both protocols for new statuses (#4815) 2017-09-06 19:01:28 +02:00
status_pin_fabricator.rb
status_stat_fabricator.rb Move status counters to separate table, count replies (#8104) 2018-08-14 19:19:32 +02:00
system_key_fabricator.rb Add E2EE API (#13820) 2020-06-02 19:24:53 +02:00
tag_fabricator.rb Ensure unique identifiers in fabricated objects in tests (#3173) 2017-05-20 17:09:40 +02:00
unavailable_domain_fabricator.rb Change delivery failure tracking to work with hostnames instead of URLs (#13437) 2020-04-15 20:33:24 +02:00
user_fabricator.rb
user_invite_request_fabricator.rb
web_push_subscription_fabricator.rb Ensure push subscription is immediately removed when application is revoked (#7548) 2018-05-19 21:05:08 +02:00
web_setting_fabricator.rb Ensure push subscription is immediately removed when application is revoked (#7548) 2018-05-19 21:05:08 +02:00
webauthn_credential_fabricator.rb