From 7bf2b049dfb5342e591a8e5f56e9d9497e6ae303 Mon Sep 17 00:00:00 2001 From: halorrr Date: Thu, 1 Feb 2024 14:07:51 -0500 Subject: [PATCH] fix the transaction_group test --- .../transactions/transaction_group_success.yml | 10 +++++----- test/lunchmoney/calls/transactions_test.rb | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/cassettes/transactions/transaction_group_success.yml b/test/cassettes/transactions/transaction_group_success.yml index 9b95034..b8655f6 100644 --- a/test/cassettes/transactions/transaction_group_success.yml +++ b/test/cassettes/transactions/transaction_group_success.yml @@ -2,7 +2,7 @@ http_interactions: - request: method: get - uri: https://dev.lunchmoney.app/v1/transactions/894063595 + uri: https://dev.lunchmoney.app/v1/transactions/group?transaction_id=894063595 body: encoding: US-ASCII string: '' @@ -23,9 +23,9 @@ http_interactions: Server: - Cowboy Report-To: - - '{"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1706476212&sid=1b10b0ff-8a76-4548-befa-353fc6c6c045&s=vpVJVG8NA0MmOXguIdFJJt5%2FeWThpyqcLi9%2FSQ4iRNo%3D"}]}' + - '{"group":"heroku-nel","max_age":3600,"endpoints":[{"url":"https://nel.heroku.com/reports?ts=1706814428&sid=1b10b0ff-8a76-4548-befa-353fc6c6c045&s=4aRFOa4c6Ovzs6jNcZayO%2B2LJyCKkoPSItlZemzMPaQ%3D"}]}' Reporting-Endpoints: - - heroku-nel=https://nel.heroku.com/reports?ts=1706476212&sid=1b10b0ff-8a76-4548-befa-353fc6c6c045&s=vpVJVG8NA0MmOXguIdFJJt5%2FeWThpyqcLi9%2FSQ4iRNo%3D + - heroku-nel=https://nel.heroku.com/reports?ts=1706814428&sid=1b10b0ff-8a76-4548-befa-353fc6c6c045&s=4aRFOa4c6Ovzs6jNcZayO%2B2LJyCKkoPSItlZemzMPaQ%3D Nel: - '{"report_to":"heroku-nel","max_age":3600,"success_fraction":0.005,"failure_fraction":0.05,"response_headers":["Via"]}' Connection: @@ -41,7 +41,7 @@ http_interactions: Etag: - W/"5b3-u9pHMnzU/IDtVfiFc+wxkhOFXqM" Date: - - Sun, 28 Jan 2024 21:10:13 GMT + - Thu, 01 Feb 2024 19:07:08 GMT Transfer-Encoding: - chunked Via: @@ -51,5 +51,5 @@ http_interactions: string: '{"id":894063595,"date":"2024-01-28","amount":"0","currency":"cad","to_base":0,"payee":"Transfer","category_id":777019,"category_name":"Payment, Transfer","category_group_id":777017,"category_group_name":"Banking","is_income":false,"exclude_from_budget":false,"exclude_from_totals":false,"created_at":"2024-01-28T18:26:44.724Z","updated_at":"2024-01-28T18:26:44.724Z","status":"cleared","is_pending":false,"notes":null,"original_name":null,"recurring_id":null,"recurring_payee":null,"recurring_description":null,"recurring_cadence":null,"recurring_type":null,"recurring_amount":null,"recurring_currency":null,"parent_id":null,"has_children":false,"group_id":null,"is_group":true,"asset_id":null,"asset_institution_name":null,"asset_name":null,"asset_display_name":null,"asset_status":null,"plaid_account_id":null,"plaid_account_name":null,"plaid_account_mask":null,"institution_name":null,"plaid_account_display_name":null,"plaid_metadata":null,"source":"user","display_name":"Transfer","display_notes":null,"account_display_name":" ","tags":[],"children":[{"id":894063594,"payee":"Transfer","amount":"-100.0000","currency":"cad","date":"2024-01-28","formatted_date":"2024-01-28","notes":null,"asset_id":92657,"plaid_account_id":null,"to_base":-100},{"id":894063593,"payee":"Transfer","amount":"100.0000","currency":"cad","date":"2024-01-28","formatted_date":"2024-01-28","notes":null,"asset_id":null,"plaid_account_id":null,"to_base":100}],"external_id":null}' - recorded_at: Sun, 28 Jan 2024 21:10:13 GMT + recorded_at: Thu, 01 Feb 2024 19:07:08 GMT recorded_with: VCR 6.2.0 diff --git a/test/lunchmoney/calls/transactions_test.rb b/test/lunchmoney/calls/transactions_test.rb index 597cb04..57501a1 100644 --- a/test/lunchmoney/calls/transactions_test.rb +++ b/test/lunchmoney/calls/transactions_test.rb @@ -55,7 +55,7 @@ class TransactionsTest < ActiveSupport::TestCase test "transaction_group returns a Transaction objects on success response" do with_real_ci_connections do VCR.use_cassette("transactions/transaction_group_success") do - api_call = LunchMoney::Calls::Transactions.new.transaction(894063595) + api_call = LunchMoney::Calls::Transactions.new.transaction_group(894063595) assert_kind_of(LunchMoney::Objects::Transaction, api_call) end @@ -66,7 +66,7 @@ class TransactionsTest < ActiveSupport::TestCase response = mock_faraday_lunchmoney_error_response LunchMoney::Calls::Transactions.any_instance.stubs(:get).returns(response) - api_call = LunchMoney::Calls::Transactions.new.transaction(893631800) + api_call = LunchMoney::Calls::Transactions.new.transaction_group(893631800) assert_kind_of(LunchMoney::Errors, api_call) end