Commit graph

17 commits

Author SHA1 Message Date
Tom Hughes
a34fa95af4 Fix rubocop warning 2024-04-21 19:07:16 +01:00
Josh Thompson
130a2ed7c1 calculate hash once per test run, per thread 2024-04-18 18:07:03 -06:00
Josh Thompson
4cac6b0354 unburden call for User fabrication
Speeds up tests rather nicely, derived via trial and error
reasonably confident that this is nice. overheard it mentioned by Vladimir
Dementyev in a Codewithjason podcast, so when my intuition already led me
to the user factory, I figured 'on principle/correctness, I should at least
look at what happens if we sidestep the native hashing library, because it's
something i was already curious about.
2024-04-17 14:03:52 -06:00
Tom Hughes
085d8ebe6a Make the user factory generate valid passwords 2024-02-27 20:52:18 +00:00
Tom Hughes
c6bb4a5f4e Add importer role that can be associated with higher rate limits 2023-11-02 08:58:12 +00:00
Tom Hughes
b5f06e06c1 Fix rubocop Rails/TimeZone warnings 2022-03-01 22:55:10 +00:00
Andy Allan
1a11c4dc19 Use a state machine for user status
The user status is a bit complex, since there are various states and
not all transitions between them make sense.

Using AASM means that we can name and restrict the transitions, which
hopefully makes them easier to reason about.
2022-01-12 18:16:14 +00:00
Andy Allan
35a2d66e19 Remove require_terms_agreed configuration option
This has been set to true for 6 years in production. Refs #2097

As per other user settings, we set the terms as seen by default for tests,
and we can override that when necessary for specific tests.
2019-02-06 15:50:57 +01:00
Tom Hughes
06915a77b5 Fix FactoryBot deprecation warnings 2018-08-28 19:12:01 +01:00
Tom Hughes
b2fa947502 Replace factory_girl with factory_bot 2017-10-29 19:29:30 +00:00
Andy Allan
eac26c9a2c Create a super_user factory. 2017-03-09 16:21:51 +00:00
Andy Allan
91f3339b6a Make all factory-generated users 'normal'
The use of create(:normal_user) makes the tests needlessly harder to
understand and reason about, particularly when we start using
associations in the factories.
2017-02-22 18:26:03 +00:00
Andy Allan
737a325f2e Refactor diary entry tests to use User factory 2017-02-19 16:43:32 +00:00
Andy Allan
0bd2e9ea8c Add status traits to user factory. 2017-02-02 12:55:32 +00:00
Andy Allan
38fc6331af Add moderator_user and administrator_user factories. 2017-02-02 12:38:19 +00:00
Andy Allan
9e591d8ccb Add with_home_location trait for user factories. 2017-02-02 12:08:36 +00:00
Andy Allan
589e9802a9 Create a simple user factory, and convert some basic tests. 2017-02-01 17:42:05 +00:00