FactoryGirl.define do factory :expense_line, class: ExpenseGun::ExpenseLine do name { Faker::Lorem.sentence(3) } category { FactoryGirl.create(:category) } date { Faker::Date.backward(30) } total_all_taxes { rand(100..1000) } vat { rand(1..(total_all_taxes/5)) } company_part { [25, 50, 75, 100].sample } end end