Randomize sign-in tests

This commit is contained in:
2023-04-14 00:15:33 +02:00
parent a13c0ee5fe
commit cc857a74bf
2 changed files with 17 additions and 5 deletions

View File

@@ -10,4 +10,12 @@ class ActiveSupport::TestCase
fixtures :all
include AbstractController::Translation
def randomize_user_password!(user)
random_password.tap { |p| user.update!(password: p) }
end
def random_password
SecureRandom.alphanumeric rand(Rails.configuration.devise.password_length)
end
end