diff --git a/lib/tasks/devseed.rake b/lib/tasks/devseed.rake index 041998f..6708eeb 100644 --- a/lib/tasks/devseed.rake +++ b/lib/tasks/devseed.rake @@ -5,7 +5,12 @@ unless Rails.env.production? users = FactoryGirl.create_list(:user, 20) 100.times do sample_users = users.sample(2) - FactoryGirl.create :transaction, debtor: sample_users[0], creditor: sample_users[1], amount: 1 + rand(100) + FactoryGirl.create :transaction, debtor: sample_users[0], creditor: sample_users[1] + end + clients = FactoryGirl.create_list(:client, 5) + 100.times do + debtor, creditor = users.sample(2) + FactoryGirl.create :client_transaction, issuer: clients.sample, debtor: debtor, creditor: creditor end end end diff --git a/spec/factories/transactions.rb b/spec/factories/transactions.rb index 237b789..23de4b8 100644 --- a/spec/factories/transactions.rb +++ b/spec/factories/transactions.rb @@ -19,7 +19,7 @@ FactoryGirl.define do association :debtor, factory: :user association :creditor, factory: :user issuer { debtor } - amount { 1 + rand(100) } + amount { 1 + rand(10000) } message { Faker::Lorem.sentence } factory :client_transaction do association :issuer, factory: :client