mirror of
https://github.com/we-promise/sure.git
synced 2026-05-09 05:35:00 +00:00
fix: currency being ignored for properties (#1556)
* fix: add property with different currency is not updating * fix: add property with different currency test * fix: code review * fix: code review
This commit is contained in:
committed by
GitHub
parent
9b2c80768c
commit
c9f9e04071
@@ -14,6 +14,7 @@ class PropertiesControllerTest < ActionDispatch::IntegrationTest
|
||||
account: {
|
||||
name: "New Property",
|
||||
subtype: "house",
|
||||
currency: "EUR",
|
||||
institution_name: "Property Lender",
|
||||
institution_domain: "propertylender.example",
|
||||
notes: "Property notes",
|
||||
@@ -31,6 +32,7 @@ class PropertiesControllerTest < ActionDispatch::IntegrationTest
|
||||
assert created_account.accountable.is_a?(Property)
|
||||
assert_equal "draft", created_account.status
|
||||
assert_equal 0, created_account.balance
|
||||
assert_equal "EUR", created_account.currency
|
||||
assert_equal "Property Lender", created_account[:institution_name]
|
||||
assert_equal "propertylender.example", created_account[:institution_domain]
|
||||
assert_equal "Property notes", created_account[:notes]
|
||||
@@ -93,8 +95,12 @@ class PropertiesControllerTest < ActionDispatch::IntegrationTest
|
||||
}
|
||||
}
|
||||
|
||||
@account.reload
|
||||
assert_equal 600000, @account.balance
|
||||
assert_equal "EUR", @account.currency
|
||||
|
||||
# If account is active, it renders balances view; otherwise redirects to address
|
||||
if @account.reload.active?
|
||||
if @account.active?
|
||||
assert_response :success
|
||||
else
|
||||
assert_redirected_to address_property_path(@account)
|
||||
|
||||
Reference in New Issue
Block a user