Make the user factory generate valid passwords

This commit is contained in:
Tom Hughes 2024-02-27 20:52:18 +00:00
parent c014b39175
commit 085d8ebe6a

View file

@ -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.