2016-07-04 19:20:10 +02:00
|
|
|
require 'test_helper'
|
|
|
|
|
|
|
|
class WalletTransactionTest < ActiveSupport::TestCase
|
2016-07-05 12:15:26 +02:00
|
|
|
test 'transaction type must be credit or debit' do
|
2016-07-20 13:03:46 +02:00
|
|
|
@jdupond = User.find_by(username: 'jdupond')
|
|
|
|
@jdupond_wallet = @jdupond.wallet
|
2019-06-03 16:00:09 +02:00
|
|
|
transaction = WalletTransaction.new amount: 5, invoicing_profile: @jdupond.invoicing_profile, wallet: @jdupond_wallet
|
2016-07-05 12:15:26 +02:00
|
|
|
transaction.transaction_type = 'credit'
|
|
|
|
assert transaction.valid?
|
|
|
|
transaction.transaction_type = 'debit'
|
|
|
|
assert transaction.valid?
|
|
|
|
transaction.transaction_type = 'other'
|
|
|
|
assert_not transaction.valid?
|
|
|
|
end
|
2016-07-04 19:20:10 +02:00
|
|
|
end
|