Skip to content
Snippets Groups Projects
  1. Feb 10, 2022
  2. Feb 09, 2022
  3. Feb 08, 2022
  4. Feb 07, 2022
  5. Feb 06, 2022
  6. Feb 05, 2022
  7. Feb 03, 2022
  8. Feb 01, 2022
  9. Jan 31, 2022
  10. Jan 30, 2022
  11. Jan 28, 2022
  12. Jan 27, 2022
    • Claire's avatar
      Refactor and improve tests (#17386) · e38fc319
      Claire authored
      * 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.
      e38fc319
Loading