1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/test/models/wallet_transaction_test.rb

18 lines
604 B
Ruby
Raw Normal View History

2023-03-22 17:30:37 +01:00
# frozen_string_literal: true
2016-07-04 19:20:10 +02:00
require 'test_helper'
class WalletTransactionTest < ActiveSupport::TestCase
test 'transaction type must be credit or debit' do
@jdupond = User.find_by(username: 'jdupond')
@jdupond_wallet = @jdupond.wallet
transaction = WalletTransaction.new amount: 5, invoicing_profile: @jdupond.invoicing_profile, wallet: @jdupond_wallet
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