mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 11:34:13 +00:00
Only update account balance if changed (#1676)
* Only update balance if changed * Update test assertions
This commit is contained in:
@@ -61,11 +61,11 @@ module AccountableResourceInterfaceTest
|
||||
assert_equal "#{@account.accountable_name.humanize} account created", flash[:notice]
|
||||
end
|
||||
|
||||
test "updates account balance by creating new valuation" do
|
||||
test "updates account balance by creating new valuation if balance has changed" do
|
||||
assert_difference [ "Account::Entry.count", "Account::Valuation.count" ], 1 do
|
||||
patch account_url(@account), params: {
|
||||
account: {
|
||||
balance: 10000
|
||||
balance: 12000
|
||||
}
|
||||
}
|
||||
end
|
||||
@@ -81,7 +81,7 @@ module AccountableResourceInterfaceTest
|
||||
assert_no_difference [ "Account::Entry.count", "Account::Valuation.count" ] do
|
||||
patch account_url(@account), params: {
|
||||
account: {
|
||||
balance: 10000
|
||||
balance: 12000
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user