mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Data provider simplification, tests, and documentation (#1997)
* Ignore env.test from source control * Simplification of providers interface * Synth tests * Update money to use new find rates method * Remove unused issues code * Additional issue feature removals * Update price data fetching and tests * Update documentation for providers * Security test fixes * Fix self host test * Update synth usage data access * Remove AI pr schema changes
This commit is contained in:
parent
dd75cadebc
commit
f65b93a352
95 changed files with 2014 additions and 1638 deletions
|
@ -5,6 +5,9 @@ class ImportsTest < ApplicationSystemTestCase
|
|||
|
||||
setup do
|
||||
sign_in @user = users(:family_admin)
|
||||
|
||||
# Trade securities will be imported as "offline" tickers
|
||||
Security.stubs(:provider).returns(nil)
|
||||
end
|
||||
|
||||
test "transaction import" do
|
||||
|
@ -52,8 +55,6 @@ class ImportsTest < ApplicationSystemTestCase
|
|||
end
|
||||
|
||||
test "trade import" do
|
||||
Security.stubs(:search_provider).returns([])
|
||||
|
||||
visit new_import_path
|
||||
|
||||
click_on "Import investments"
|
||||
|
|
|
@ -33,6 +33,7 @@ class SettingsTest < ApplicationSystemTestCase
|
|||
|
||||
test "can update self hosting settings" do
|
||||
Rails.application.config.app_mode.stubs(:self_hosted?).returns(true)
|
||||
Providers.stubs(:synth).returns(nil)
|
||||
open_settings_from_sidebar
|
||||
assert_selector "li", text: "Self hosting"
|
||||
click_link "Self hosting"
|
||||
|
|
|
@ -10,16 +10,8 @@ class TradesTest < ApplicationSystemTestCase
|
|||
|
||||
visit_account_portfolio
|
||||
|
||||
Security.stubs(:search_provider).returns([
|
||||
Security.new(
|
||||
ticker: "AAPL",
|
||||
name: "Apple Inc.",
|
||||
logo_url: "https://logo.synthfinance.com/ticker/AAPL",
|
||||
exchange_acronym: "NASDAQ",
|
||||
exchange_mic: "XNAS",
|
||||
country_code: "US"
|
||||
)
|
||||
])
|
||||
# Disable provider to focus on form testing
|
||||
Security.stubs(:provider).returns(nil)
|
||||
end
|
||||
|
||||
test "can create buy transaction" do
|
||||
|
@ -28,7 +20,6 @@ class TradesTest < ApplicationSystemTestCase
|
|||
open_new_trade_modal
|
||||
|
||||
fill_in "Ticker symbol", with: "AAPL"
|
||||
select_combobox_option("Apple")
|
||||
fill_in "Date", with: Date.current
|
||||
fill_in "Quantity", with: shares_qty
|
||||
fill_in "account_entry[price]", with: 214.23
|
||||
|
@ -50,7 +41,6 @@ class TradesTest < ApplicationSystemTestCase
|
|||
|
||||
select "Sell", from: "Type"
|
||||
fill_in "Ticker symbol", with: aapl.ticker
|
||||
select_combobox_option(aapl.security.name)
|
||||
fill_in "Date", with: Date.current
|
||||
fill_in "Quantity", with: aapl.qty
|
||||
fill_in "account_entry[price]", with: 215.33
|
||||
|
@ -81,10 +71,4 @@ class TradesTest < ApplicationSystemTestCase
|
|||
def visit_account_portfolio
|
||||
visit account_path(@account, tab: "holdings")
|
||||
end
|
||||
|
||||
def select_combobox_option(text)
|
||||
within "#account_entry_ticker-hw-listbox" do
|
||||
find("li", text: text).click
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue