mirror of
https://github.com/we-promise/sure.git
synced 2026-04-17 11:04:14 +00:00
Add instituion details & notes to Account model (#481)
- Add institution name & domain, to allow fetching logos when no provider is configured - Add free-form textarea for storing misc. notes (eg. sort codes, account numbers) - Update account settings form to support these new fields
This commit is contained in:
committed by
GitHub
parent
104324a82b
commit
68864b1fdb
@@ -14,6 +14,9 @@ class PropertiesControllerTest < ActionDispatch::IntegrationTest
|
||||
account: {
|
||||
name: "New Property",
|
||||
subtype: "house",
|
||||
institution_name: "Property Lender",
|
||||
institution_domain: "propertylender.example",
|
||||
notes: "Property notes",
|
||||
accountable_type: "Property",
|
||||
accountable_attributes: {
|
||||
year_built: 1990,
|
||||
@@ -28,6 +31,9 @@ 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 "Property Lender", created_account[:institution_name]
|
||||
assert_equal "propertylender.example", created_account[:institution_domain]
|
||||
assert_equal "Property notes", created_account[:notes]
|
||||
assert_equal 1990, created_account.accountable.year_built
|
||||
assert_equal 1200, created_account.accountable.area_value
|
||||
assert_equal "sqft", created_account.accountable.area_unit
|
||||
@@ -39,6 +45,9 @@ class PropertiesControllerTest < ActionDispatch::IntegrationTest
|
||||
patch property_path(@account), params: {
|
||||
account: {
|
||||
name: "Updated Property",
|
||||
institution_name: "Updated Lender",
|
||||
institution_domain: "updatedlender.example",
|
||||
notes: "Updated property notes",
|
||||
accountable_attributes: {
|
||||
id: @account.accountable.id,
|
||||
subtype: "condominium"
|
||||
@@ -50,6 +59,9 @@ class PropertiesControllerTest < ActionDispatch::IntegrationTest
|
||||
@account.reload
|
||||
assert_equal "Updated Property", @account.name
|
||||
assert_equal "condominium", @account.subtype
|
||||
assert_equal "Updated Lender", @account[:institution_name]
|
||||
assert_equal "updatedlender.example", @account[:institution_domain]
|
||||
assert_equal "Updated property notes", @account[:notes]
|
||||
|
||||
# If account is active, it renders edit view; otherwise redirects to balances
|
||||
if @account.active?
|
||||
|
||||
Reference in New Issue
Block a user