mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-23 07:09:39 +02:00
Fix duplicate category creation on import (#791)
* Repro * Fix * Update signage
This commit is contained in:
parent
77f166a5f8
commit
41c991384a
4 changed files with 24 additions and 12 deletions
|
@ -39,7 +39,10 @@ class ImportTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
test "publishes a valid import" do
|
||||
assert_difference -> { Transaction::Category.count } => 2, -> { Transaction.count } => 2 do
|
||||
# Import has 3 unique categories: "Food & Drink", "Income", and "Shopping" (x2)
|
||||
# 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, -> { Transaction::Category.count } => 1 do
|
||||
@loaded_import.publish
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue