You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mastodon/spec/controllers/api/v1
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.
3 years ago
..
accounts Refactor and improve tests (#17386) 3 years ago
admin Refactor and improve tests (#17386) 3 years ago
announcements Add announcements (#12662) 5 years ago
apps Use raw status code on have_http_status (#7214) 7 years ago
instances Add specs for Api::V1::Instances::PeersController (#9546) 6 years ago
lists Refactor and improve tests (#17386) 3 years ago
polls Refactor and improve tests (#17386) 3 years ago
push Add `policy` param to `POST /api/v1/push/subscriptions` (#16040) 4 years ago
statuses Refactor and improve tests (#17386) 3 years ago
timelines Refactor and improve tests (#17386) 3 years ago
trends Add trending links (#16917) 3 years ago
accounts_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
announcements_controller_spec.rb Add announcements (#12662) 5 years ago
apps_controller_spec.rb Fix app name, website and redirect URIs not having a maximum length (#16042) 4 years ago
blocks_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
bookmarks_controller_spec.rb Support min_id-based pagination for bookmarks (#12381) 5 years ago
conversations_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
custom_emojis_controller_spec.rb Use raw status code on have_http_status (#7214) 7 years ago
domain_blocks_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
endorsements_controller_spec.rb Add spec for Api::V1::EndorsementsController (#9543) 6 years ago
favourites_controller_spec.rb Support min_id-based pagination in REST API (#8736) 7 years ago
filters_controller_spec.rb Add polls (#10111) 6 years ago
follow_requests_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
instances_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
lists_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
markers_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
media_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
mutes_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
notifications_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
polls_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
reports_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
statuses_controller_spec.rb Refactor and improve tests (#17386) 3 years ago
streaming_controller_spec.rb Lint pass (#8876) 7 years ago
suggestions_controller_spec.rb Re-add follow recommendations API (#7918) 7 years ago