mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Find account first and build transaction through association (#487)
* Find account first and build transaction through association * Fix flaky test
This commit is contained in:
@@ -17,11 +17,12 @@ class TransactionsControllerTest < ActionDispatch::IntegrationTest
|
||||
end
|
||||
|
||||
test "should create transaction" do
|
||||
name = "transaction_name"
|
||||
assert_difference("Transaction.count") do
|
||||
post transactions_url, params: { transaction: { account_id: @transaction.account_id, amount: @transaction.amount, currency: @transaction.currency, date: @transaction.date, name: @transaction.name } }
|
||||
post transactions_url, params: { transaction: { account_id: @transaction.account_id, amount: @transaction.amount, currency: @transaction.currency, date: @transaction.date, name: } }
|
||||
end
|
||||
|
||||
assert_redirected_to transaction_url(Transaction.last)
|
||||
assert_redirected_to transaction_url(Transaction.find_by(name:))
|
||||
end
|
||||
|
||||
test "should show transaction" do
|
||||
|
||||
Reference in New Issue
Block a user