The personal finance app for everyone (by everyone)
Ruby
Wire @kraken_items into the accounts index (#2770)
pro39588e6035c62cb0
diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rbindex f2e3d8f606..223483f6b3 100644--- a/app/controllers/accounts_controller.rb+++ b/app/controllers/accounts_controller.rb@@ -29,6 +29,7 @@ class AccountsController < ApplicationController@indexa_capital_items = visible_provider_items(family.indexa_capital_items.ordered.with_attached_logo.includes(:indexa_capital_accounts))@sophtron_items = visible_provider_items(family.sophtron_items.ordered.with_attached_logo.includes(:sophtron_accounts))@binance_items = visible_provider_items(family.binance_items.ordered.with_attached_logo.includes(:binance_accounts, :accounts))+ @kraken_items = visible_provider_items(family.kraken_items.ordered.with_attached_logo.includes(:kraken_accounts, :accounts))@questrade_items = visible_provider_items(family.questrade_items.ordered.with_attached_logo.includes(:accounts, questrade_accounts: :account_provider))@wise_items = visible_provider_items(family.wise_items.ordered.includes(:wise_accounts, :accounts))@@ -307,6 +308,7 @@ class AccountsController < ApplicationController@indexa_capital_items,@sophtron_items,@binance_items,+ @kraken_items,@questrade_items,@wise_items].flatten.compactdiff --git a/app/views/accounts/index.html.erb b/app/views/accounts/index.html.erbindex 5dff033c59..d038130490 100644--- a/app/views/accounts/index.html.erb+++ b/app/views/accounts/index.html.erb@@ -10,7 +10,7 @@) %><% end %>-<% if @manual_accounts.empty? && @plaid_items.empty? && @simplefin_items.empty? && @lunchflow_items.empty? && @redbark_items.empty? && @akahu_items.empty? && @up_items.empty? && @enable_banking_items.empty? && @coinstats_items.empty? && @coinbase_items.empty? && @mercury_items.empty? && @brex_items.empty? && @ibkr_items.empty? && @snaptrade_items.empty? && @indexa_capital_items.empty? && @sophtron_items.empty? && @binance_items.empty? && @questrade_items.empty? && @wise_items.empty? %>+<% if @manual_accounts.empty? && @plaid_items.empty? && @simplefin_items.empty? && @lunchflow_items.empty? && @redbark_items.empty? && @akahu_items.empty? && @up_items.empty? && @enable_banking_items.empty? && @coinstats_items.empty? && @coinbase_items.empty? && @mercury_items.empty? && @brex_items.empty? && @ibkr_items.empty? && @snaptrade_items.empty? && @indexa_capital_items.empty? && @sophtron_items.empty? && @binance_items.empty? && @kraken_items.empty? && @questrade_items.empty? && @wise_items.empty? %><%= render "empty" %><% else %><div class="space-y-2">@@ -66,6 +66,10 @@<%= render @binance_items.sort_by(&:created_at) %><% end %>+ <% if @kraken_items.any? %>+ <%= render @kraken_items.sort_by(&:created_at) %>+ <% end %>+<% if @wise_items.any? %><%= render @wise_items.sort_by(&:created_at) %><% end %>diff --git a/test/controllers/accounts_controller_test.rb b/test/controllers/accounts_controller_test.rbindex dd1a5eb3e6..d62ed2e7d3 100644--- a/test/controllers/accounts_controller_test.rb+++ b/test/controllers/accounts_controller_test.rb@@ -14,6 +14,13 @@ class AccountsControllerTest < ActionDispatch::IntegrationTestassert_select "p.ml-auto.privacy-sensitive"end+ test "index renders kraken items" do+ kraken_item = kraken_items(:one)+ get accounts_url+ assert_response :success+ assert_select "##{dom_id(kraken_item)}"+ end+test "should get show" doget account_url(@account)assert_response :success