From: Tom Hughes Date: Tue, 27 Feb 2024 20:52:18 +0000 (+0000) Subject: Make the user factory generate valid passwords X-Git-Tag: live~790 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/085d8ebe6a6cfd490d52de959b14c1b2bd7da6f6?ds=sidebyside;hp=c014b39175605bc3191f20678cbaa56038efe933 Make the user factory generate valid passwords --- diff --git a/test/factories/user.rb b/test/factories/user.rb index 166461637..5b92345c2 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 { Digest::MD5.hexdigest("test") } + pass_crypt { PasswordHash.create("test").first } # These attributes are not the defaults, but in most tests we want # a 'normal' user who can log in without being redirected etc.