mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-28 09:39:39 +02:00
Remove manual merchant management (rules will replace)
This commit is contained in:
parent
f07940bf45
commit
83dcbd9ff0
44 changed files with 123 additions and 386 deletions
|
@ -49,8 +49,7 @@ class Account::TransactionsControllerTest < ActionDispatch::IntegrationTest
|
|||
entryable_attributes: {
|
||||
id: @entry.entryable_id,
|
||||
tag_ids: [ Tag.first.id, Tag.second.id ],
|
||||
category_id: Category.first.id,
|
||||
merchant_id: Merchant.first.id
|
||||
category_id: Category.first.id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +63,6 @@ class Account::TransactionsControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_equal -100, @entry.amount
|
||||
assert_equal [ Tag.first.id, Tag.second.id ], @entry.entryable.tag_ids.sort
|
||||
assert_equal Category.first.id, @entry.entryable.category_id
|
||||
assert_equal Merchant.first.id, @entry.entryable.merchant_id
|
||||
assert_equal "test notes", @entry.notes
|
||||
assert_equal false, @entry.excluded
|
||||
|
||||
|
@ -98,7 +96,6 @@ class Account::TransactionsControllerTest < ActionDispatch::IntegrationTest
|
|||
entry_ids: transactions.map(&:id),
|
||||
date: 1.day.ago.to_date,
|
||||
category_id: Category.second.id,
|
||||
merchant_id: Merchant.second.id,
|
||||
notes: "Updated note"
|
||||
}
|
||||
}
|
||||
|
@ -110,7 +107,6 @@ class Account::TransactionsControllerTest < ActionDispatch::IntegrationTest
|
|||
transactions.reload.each do |transaction|
|
||||
assert_equal 1.day.ago.to_date, transaction.date
|
||||
assert_equal Category.second, transaction.account_transaction.category
|
||||
assert_equal Merchant.second, transaction.account_transaction.merchant
|
||||
assert_equal "Updated note", transaction.notes
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
require "test_helper"
|
||||
|
||||
class MerchantsControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
sign_in @user = users(:family_admin)
|
||||
@merchant = merchants(:netflix)
|
||||
end
|
||||
|
||||
test "index" do
|
||||
get merchants_path
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "new" do
|
||||
get new_merchant_path
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create merchant" do
|
||||
assert_difference("Merchant.count") do
|
||||
post merchants_url, params: { merchant: { name: "new merchant", color: "#000000" } }
|
||||
end
|
||||
|
||||
assert_redirected_to merchants_path
|
||||
end
|
||||
|
||||
test "should update merchant" do
|
||||
patch merchant_url(@merchant), params: { merchant: { name: "new name", color: "#000000" } }
|
||||
assert_redirected_to merchants_path
|
||||
end
|
||||
|
||||
test "should destroy merchant" do
|
||||
assert_difference("Merchant.count", -1) do
|
||||
delete merchant_url(@merchant)
|
||||
end
|
||||
|
||||
assert_redirected_to merchants_path
|
||||
end
|
||||
end
|
|
@ -50,7 +50,6 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
|
|||
assert_not Account.exists?(account.id)
|
||||
assert_not Category.exists?(category.id)
|
||||
assert_not Tag.exists?(tag.id)
|
||||
assert_not Merchant.exists?(merchant.id)
|
||||
assert_not Import.exists?(import.id)
|
||||
assert_not Budget.exists?(budget.id)
|
||||
assert_not PlaidItem.exists?(plaid_item.id)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue