mastodon/spec/controllers/admin
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
..
account_moderation_notes_controller_spec.rb
accounts_controller_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
action_logs_controller_spec.rb
base_controller_spec.rb
change_email_controller_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
confirmations_controller_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
custom_emojis_controller_spec.rb
dashboard_controller_spec.rb Add Ruby 3.0 support (#16046) 2021-05-06 14:22:54 +02:00
domain_blocks_controller_spec.rb
email_domain_blocks_controller_spec.rb
instances_controller_spec.rb Add ability to purge undeliverable domains from admin interface (#16686) 2021-12-17 23:01:21 +01:00
invites_controller_spec.rb
report_notes_controller_spec.rb Add notifications for statuses deleted by moderators (#17204) 2022-01-17 09:41:33 +01:00
reports_controller_spec.rb Add notifications for statuses deleted by moderators (#17204) 2022-01-17 09:41:33 +01:00
resets_controller_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
roles_controller_spec.rb
settings_controller_spec.rb
statuses_controller_spec.rb Add notifications for statuses deleted by moderators (#17204) 2022-01-17 09:41:33 +01:00
tags_controller_spec.rb Add trending links (#16917) 2021-11-25 13:07:38 +01:00
two_factor_authentications_controller_spec.rb Add ability to skip sign-in token authentication for specific users (#16427) 2021-07-08 05:31:28 +02:00