The personal finance app for everyone (by everyone)
Ruby
fix(transfers): hide disabled accounts from new transfer modal (#3376)
Ellion Blessan4794d4ee15fd
diff --git a/app/controllers/transfers_controller.rb b/app/controllers/transfers_controller.rbindex 81a851f32a..692c41b64e 100644--- a/app/controllers/transfers_controller.rb+++ b/app/controllers/transfers_controller.rb@@ -225,6 +225,7 @@ class TransfersController < ApplicationControllerdef set_accounts@accounts = accessible_accounts+ .active.alphabetically.includes(:account_providers,diff --git a/test/controllers/transfers_controller_test.rb b/test/controllers/transfers_controller_test.rbindex 94b2d9cbfa..b87575ed1e 100644--- a/test/controllers/transfers_controller_test.rb+++ b/test/controllers/transfers_controller_test.rb@@ -10,6 +10,16 @@ class TransfersControllerTest < ActionDispatch::IntegrationTestassert_response :successend+ test "excludes disabled accounts from the new transfer form" do+ disabled_account = accounts(:depository)+ disabled_account.update!(status: "disabled")++ get new_transfer_url++ assert_response :success+ assert_no_match disabled_account.name, response.body+ end+test "can create transfers" doassert_difference "Transfer.count", 1 dopost transfers_url, params: {