__tests__/lib/utils.rb in voucherify-5.0.0 vs __tests__/lib/utils.rb in voucherify-6.0.0
- old
+ new
@@ -1,5 +1,9 @@
def generate_random_string(length=10)
chars = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a
random_string = Array.new(length) { chars.sample }.join
return random_string
end
+
+def generate_random_voucher_codes(base_code, count, length=6)
+ (1..count).map { "#{base_code}-#{generate_random_string(length)}" }
+end
\ No newline at end of file