1
0
mirror of https://github.com/funamitech/mastodon synced 2024-11-24 15:16:33 +09:00
YuruToot/spec/controllers/concerns
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_controller_concern_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
accountable_concern_spec.rb Refactor and improve tests (#17386) 2022-01-28 00:46:42 +01:00
cache_concern_spec.rb Fix cache_collection crashing when given an empty collection (#15921) 2021-03-18 00:41:32 +01:00
challengable_concern_spec.rb Add password challenge to 2FA settings, e-mail notifications (#11878) 2019-09-18 16:37:27 +02:00
export_controller_concern_spec.rb Prepare Mastodon for Rails 6 (#15911) 2021-03-17 10:09:55 +01:00
localized_spec.rb Fix sr locale being selected over sr-Latn (#13693) 2020-05-11 01:09:21 +02:00
rate_limit_headers_spec.rb Rate limit by user instead of IP when API user is authenticated (#5923) 2017-12-09 14:20:02 +01:00
signature_verification_spec.rb Change signature verification to ignore signatures with invalid host (#13033) 2020-02-03 17:48:23 +01:00
user_tracking_concern_spec.rb Fix regeneration marker not expiring (#6290) 2018-01-18 20:29:56 +01:00