mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Account namespace updates: part 4 (transfers, singular namespacing) (#896)
* Move Transfer to Account namespace * Fix partial resolution due to namespacing plurality * Make category and tag controllers consistent with namespacing convention * Update stale partial reference
This commit is contained in:
@@ -8,14 +8,14 @@ class TransferTest < ActiveSupport::TestCase
|
||||
end
|
||||
|
||||
test "transfer valid if it has inflow and outflow from different accounts for the same amount" do
|
||||
transfer = Transfer.create! transactions: [ @inflow, @outflow ]
|
||||
transfer = Account::Transfer.create! transactions: [ @inflow, @outflow ]
|
||||
|
||||
assert transfer.valid?
|
||||
end
|
||||
|
||||
test "transfer must have 2 transactions" do
|
||||
invalid_transfer_1 = Transfer.new transactions: [ @outflow ]
|
||||
invalid_transfer_2 = Transfer.new transactions: [ @inflow, @outflow, transactions(:savings_four) ]
|
||||
invalid_transfer_1 = Account::Transfer.new transactions: [ @outflow ]
|
||||
invalid_transfer_2 = Account::Transfer.new transactions: [ @inflow, @outflow, transactions(:savings_four) ]
|
||||
|
||||
assert invalid_transfer_1.invalid?
|
||||
assert invalid_transfer_2.invalid?
|
||||
@@ -27,7 +27,7 @@ class TransferTest < ActiveSupport::TestCase
|
||||
outflow = account.transactions.create! date: Date.current, name: "Outflow", amount: 100
|
||||
|
||||
assert_raise ActiveRecord::RecordInvalid do
|
||||
Transfer.create! transactions: [ inflow, outflow ]
|
||||
Account::Transfer.create! transactions: [ inflow, outflow ]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -35,7 +35,7 @@ class TransferTest < ActiveSupport::TestCase
|
||||
@inflow.update! marked_as_transfer: false
|
||||
|
||||
assert_raise ActiveRecord::RecordInvalid do
|
||||
Transfer.create! transactions: [ @inflow, @outflow ]
|
||||
Account::Transfer.create! transactions: [ @inflow, @outflow ]
|
||||
end
|
||||
end
|
||||
|
||||
@@ -43,7 +43,7 @@ class TransferTest < ActiveSupport::TestCase
|
||||
@outflow.update! amount: 105
|
||||
|
||||
assert_raises ActiveRecord::RecordInvalid do
|
||||
Transfer.create! transactions: [ @inflow, @outflow ]
|
||||
Account::Transfer.create! transactions: [ @inflow, @outflow ]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user