Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can update_recurring_donation with a status_message nil #57

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading