Add Unit system tests

This commit is contained in:
2024-01-05 04:16:38 +01:00
parent 6d9f4918f1
commit 32b8daf29d
2 changed files with 43 additions and 0 deletions

View File

@@ -12,6 +12,14 @@ class ActiveSupport::TestCase
include AbstractController::Translation
include ActionMailer::TestHelper
# NOTE: use public #alphanumeric(chars: ...) from Ruby 3.3 onwards
SecureRandom.class_eval do
def self.random_symbol(n = 10)
# Unicode characters: 32-126, 160-383
choose([*' '..'~', 160.chr, *'¡'..'ſ'], n)
end
end
def randomize_user_password!(user)
random_password.tap { |p| user.update!(password: p) }
end