Skip to content

Commit

Permalink
can update_recurring_donation with a status_message nil (#57)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: Taylor Brooks <[email protected]>
  • Loading branch information
joshcrews and taylorbrooks authored Feb 27, 2024
1 parent 8b17262 commit 23d5fee
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rock_rms/resources/recurring_donation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def update_recurring_donation(
options['EndDate'] = end_date if end_date
options['Summary'] = summary if summary
options['Status'] = status if status
options['StatusMessage'] = status_message if status_message
options['StatusMessage'] = status_message if status_message || status_message == ''

patch(recurring_donation_path(id), options)
end
Expand Down
19 changes: 19 additions & 0 deletions spec/rock_rms/resources/recurring_donation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,25 @@
expect(resource).to be_nil
end

it 'updates status_message with nil' do
expect(client).to receive(:patch)
.with(
'FinancialScheduledTransactions/123',
{
'NextPaymentDate' => '2018-01-01',
'StatusMessage' => ''
}
).and_call_original

resource = client.update_recurring_donation(
123,
next_payment_date: '2018-01-01',
status_message: ''
)

expect(resource).to be_nil
end

context 'arguments' do
it 'require `id`' do
expect { client.update_recurring_donation }
Expand Down

0 comments on commit 23d5fee

Please sign in to comment.