Method: FactoryBot.rand_id

Defined in:
lib/ledger_sync/test/support/factory_bot.rb

.rand_id(*appends, include_test_run_id: true) ⇒ Object



91
92
93
94
95
96
97
98
99
# File 'lib/ledger_sync/test/support/factory_bot.rb', line 91

def self.rand_id(*appends, include_test_run_id: true)
  ret = ''
  ret += test_run_id if include_test_run_id
  ret += (0...8).map { rand(65..90).chr }.join
  appends.each do |append|
    ret += "-#{append}"
  end
  ret
end