mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Add tax treatment classification for investment accounts with international support (#693)
* Add tax treatment support for accounts, investments, and cryptos * Replace hardcoded region labels with I18n translations * Add I18n support for subtype labels with fallback to hardcoded values * fixed schema --------- Co-authored-by: luckyPipewrench <luckypipewrench@proton.me>
This commit is contained in:
30
test/models/crypto_test.rb
Normal file
30
test/models/crypto_test.rb
Normal file
@@ -0,0 +1,30 @@
|
||||
require "test_helper"
|
||||
|
||||
class CryptoTest < ActiveSupport::TestCase
|
||||
test "tax_treatment defaults to taxable" do
|
||||
crypto = Crypto.new
|
||||
assert_equal "taxable", crypto.tax_treatment
|
||||
end
|
||||
|
||||
test "tax_treatment can be set to tax_deferred" do
|
||||
crypto = Crypto.new(tax_treatment: :tax_deferred)
|
||||
assert_equal "tax_deferred", crypto.tax_treatment
|
||||
end
|
||||
|
||||
test "tax_treatment can be set to tax_exempt" do
|
||||
crypto = Crypto.new(tax_treatment: :tax_exempt)
|
||||
assert_equal "tax_exempt", crypto.tax_treatment
|
||||
end
|
||||
|
||||
test "tax_treatment enum provides predicate methods" do
|
||||
crypto = Crypto.new(tax_treatment: :taxable)
|
||||
assert crypto.taxable?
|
||||
assert_not crypto.tax_deferred?
|
||||
assert_not crypto.tax_exempt?
|
||||
|
||||
crypto.tax_treatment = :tax_deferred
|
||||
assert_not crypto.taxable?
|
||||
assert crypto.tax_deferred?
|
||||
assert_not crypto.tax_exempt?
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user