Skip to content

Commit

Permalink
delete_transaction_detail; (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshcrews authored Oct 31, 2024
1 parent 2a7af4b commit d264dd0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rock_rms/resources/transaction_detail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 11 additions & 0 deletions spec/rock_rms/resources/transaction_detail_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions spec/support/rock_mock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class RockMock < Sinatra::Base
'FinancialPaymentDetails/:id',
'FinancialPersonSavedAccounts/:id',
'FinancialTransactions/:id',
'FinancialTransactionDetails/:id',
'FinancialScheduledTransactionDetails/:id',
'GroupMembers/:id'
].each do |end_point|
Expand Down

0 comments on commit d264dd0

Please sign in to comment.