Sha256: 0695fa4cb74825949cee34c2dbf35e24177bbc81488d206736171b2b3654f0ab

Contents?: true

Size: 804 Bytes

Versions: 1

Compression:

Stored size: 804 Bytes

Contents

require 'bigdecimal'
FactoryBot.define do
  factory :amount, :class => Plutus::Amount do |amount|
    amount.amount BigDecimal.new('473')
    amount.association :entry, :factory => :entry_with_credit_and_debit
    amount.association :account, :factory => :asset
  end

  factory :credit_amount, :class => Plutus::CreditAmount do |credit_amount|
    credit_amount.amount BigDecimal.new('473')
    credit_amount.association :entry, :factory => :entry_with_credit_and_debit
    credit_amount.association :account, :factory => :revenue
  end

  factory :debit_amount, :class => Plutus::DebitAmount do |debit_amount|
    debit_amount.amount BigDecimal.new('473')
    debit_amount.association :entry, :factory => :entry_with_credit_and_debit
    debit_amount.association :account, :factory => :asset
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tyche-0.14 spec/factories/amount_factory.rb