From 4cac6b035410619a4b6bece8be6f224fb06b3c87 Mon Sep 17 00:00:00 2001 From: Josh Thompson Date: Wed, 17 Apr 2024 13:52:39 -0600 Subject: [PATCH] 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. --- test/factories/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/factories/user.rb b/test/factories/user.rb index 5b92345c2..7823c0e9f 100644 --- a/test/factories/user.rb +++ b/test/factories/user.rb @@ -2,7 +2,7 @@ FactoryBot.define do 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. -- 2.45.1