Skip to content

Commit

Permalink
unburden call for User fabrication
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
josh-works committed Apr 17, 2024
1 parent dd77541 commit 4cac6b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/factories/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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.
Expand Down

0 comments on commit 4cac6b0

Please sign in to comment.