From d264dd05161546513ae2ba99676fb6f2c8533044 Mon Sep 17 00:00:00 2001 From: Josh Crews Date: Thu, 31 Oct 2024 11:25:58 -0500 Subject: [PATCH] delete_transaction_detail; (#63) --- lib/rock_rms/resources/transaction_detail.rb | 4 ++++ spec/rock_rms/resources/transaction_detail_spec.rb | 11 +++++++++++ spec/support/rock_mock.rb | 1 + 3 files changed, 16 insertions(+) diff --git a/lib/rock_rms/resources/transaction_detail.rb b/lib/rock_rms/resources/transaction_detail.rb index 6d96e27..6355932 100644 --- a/lib/rock_rms/resources/transaction_detail.rb +++ b/lib/rock_rms/resources/transaction_detail.rb @@ -52,6 +52,10 @@ def create_transaction_detail( post(transaction_detail_path, options) end + def delete_transaction_detail(id) + delete(transaction_detail_path(id)) + end + private def transaction_detail_path(id = nil) diff --git a/spec/rock_rms/resources/transaction_detail_spec.rb b/spec/rock_rms/resources/transaction_detail_spec.rb index 9534d95..dc40c09 100644 --- a/spec/rock_rms/resources/transaction_detail_spec.rb +++ b/spec/rock_rms/resources/transaction_detail_spec.rb @@ -111,5 +111,16 @@ end end + describe '#delete_transaction_detail' do + it 'returns nothing' do + expect(client.delete_transaction_detail(123)).to eq(nil) + end + + it 'passes id' do + expect(client).to receive(:delete).with('FinancialTransactionDetails/123') + client.delete_transaction_detail(123) + end + end + end end diff --git a/spec/support/rock_mock.rb b/spec/support/rock_mock.rb index 2230b39..9ef8dcb 100644 --- a/spec/support/rock_mock.rb +++ b/spec/support/rock_mock.rb @@ -9,6 +9,7 @@ class RockMock < Sinatra::Base 'FinancialPaymentDetails/:id', 'FinancialPersonSavedAccounts/:id', 'FinancialTransactions/:id', + 'FinancialTransactionDetails/:id', 'FinancialScheduledTransactionDetails/:id', 'GroupMembers/:id' ].each do |end_point|