1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-18 20:59:39 +02:00

Consolidate and simplify account pages (#2462)
Some checks are pending
Publish Docker image / ci (push) Waiting to run
Publish Docker image / Build docker image (push) Blocked by required conditions

* Remove ScrollFocusable

* Consolidate and simplify account pages

* Lint fixes

* Fix tab param initialization

* Remove stale files

* Remove stale route, make accountable routes clearer
This commit is contained in:
Zach Gollwitzer 2025-07-18 05:52:18 -04:00 committed by GitHub
parent 3eea5a9891
commit 8c97c9d31a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 252 additions and 269 deletions

View file

@ -11,18 +11,25 @@ class AccountsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
test "should get show" do
get account_url(@account)
assert_response :success
end
test "should sync account" do
post sync_account_url(@account)
assert_redirected_to account_url(@account)
end
test "should get chart" do
get chart_account_url(@account)
assert_response :success
end
test "should get sparkline" do
get sparkline_account_url(@account)
assert_response :success
end
test "destroys account" do
delete account_url(@account)
assert_redirected_to accounts_path
assert_enqueued_with job: DestroyJob
assert_equal "Account scheduled for deletion", flash[:notice]
end
end

View file

@ -48,7 +48,7 @@ class CreditCardsControllerTest < ActionDispatch::IntegrationTest
test "updates with credit card details" do
assert_no_difference [ "Account.count", "CreditCard.count" ] do
patch account_path(@account), params: {
patch credit_card_path(@account), params: {
account: {
name: "Updated Credit Card",
balance: 2000,

View file

@ -46,7 +46,7 @@ class LoansControllerTest < ActionDispatch::IntegrationTest
test "updates with loan details" do
assert_no_difference [ "Account.count", "Loan.count" ] do
patch account_path(@account), params: {
patch loan_path(@account), params: {
account: {
name: "Updated Loan",
balance: 45000,

View file

@ -45,7 +45,7 @@ class VehiclesControllerTest < ActionDispatch::IntegrationTest
test "updates with vehicle details" do
assert_no_difference [ "Account.count", "Vehicle.count" ] do
patch account_path(@account), params: {
patch vehicle_path(@account), params: {
account: {
name: "Updated Vehicle",
balance: 28000,
@ -64,7 +64,7 @@ class VehiclesControllerTest < ActionDispatch::IntegrationTest
}
end
assert_redirected_to @account
assert_redirected_to account_path(@account)
assert_equal "Vehicle account updated", flash[:notice]
assert_enqueued_with(job: SyncJob)
end

View file

@ -14,16 +14,4 @@ module AccountableResourceInterfaceTest
get edit_account_url(@account)
assert_response :success
end
test "renders accountable page" do
get account_url(@account)
assert_response :success
end
test "destroys account" do
delete account_url(@account)
assert_redirected_to accounts_path
assert_enqueued_with job: DestroyJob
assert_equal "#{@account.accountable_name.underscore.humanize} account scheduled for deletion", flash[:notice]
end
end