mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Account namespace updates: part 6 (transactions) (#904)
* Move Transaction to Account namespace * Fix improper routes, improve separation of concerns * Replace account transactions list partial with view * Remove logs * Consolidate transaction views * Remove unused code * Transfer style tweaks * Remove more unused code * Add back totals by currency helper
This commit is contained in:
@@ -45,7 +45,7 @@ class ImportTest < ActiveSupport::TestCase
|
||||
# Fixtures already define "Food & Drink" and "Income", so these should not be created
|
||||
# "Shopping" is a new category, but should only be created 1x during import
|
||||
assert_difference \
|
||||
-> { Transaction.count } => 4,
|
||||
-> { Account::Transaction.count } => 4,
|
||||
-> { Category.count } => 1,
|
||||
-> { Tagging.count } => 4,
|
||||
-> { Tag.count } => 2 do
|
||||
@@ -59,11 +59,11 @@ class ImportTest < ActiveSupport::TestCase
|
||||
|
||||
test "publishes a valid import with missing data" do
|
||||
@empty_import.update! raw_csv_str: valid_csv_with_missing_data
|
||||
assert_difference -> { Category.count } => 1, -> { Transaction.count } => 2 do
|
||||
assert_difference -> { Category.count } => 1, -> { Account::Transaction.count } => 2 do
|
||||
@empty_import.publish
|
||||
end
|
||||
|
||||
assert_not_nil Transaction.find_sole_by(name: Import::FALLBACK_TRANSACTION_NAME)
|
||||
assert_not_nil Account::Transaction.find_sole_by(name: Import::FALLBACK_TRANSACTION_NAME)
|
||||
|
||||
@empty_import.reload
|
||||
|
||||
@@ -73,7 +73,7 @@ class ImportTest < ActiveSupport::TestCase
|
||||
test "failed publish results in error status" do
|
||||
@empty_import.update! raw_csv_str: valid_csv_with_invalid_values
|
||||
|
||||
assert_difference "Transaction.count", 0 do
|
||||
assert_difference "Account::Transaction.count", 0 do
|
||||
@empty_import.publish
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user