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.
factory :user do
sequence(:email) { |n| "user#{n}@example.com" }
sequence(:display_name) { |n| "User #{n}" }
- pass_crypt { PasswordHash.create("test").first }
+ pass_crypt { "$argon2id$v=19$m=65536,t=3,p=4$M+oP6KQOdFLDeiYa/gbzAg$pULNwXgKt2sEmTxMXxt298skEqc8MjnPwGsk075jLrk" }
# These attributes are not the defaults, but in most tests we want
# a 'normal' user who can log in without being redirected etc.