Skip to content

Commit

Permalink
Crankshaft[BU000003GFGB12] Client - Ruby @ 2017-02-20 15:13:56 +0000
Browse files Browse the repository at this point in the history
  • Loading branch information
Crankshaft Robot committed Feb 20, 2017
1 parent cf2bd4c commit 535ea22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/gocardless_pro/resources/event.rb
Expand Up @@ -48,7 +48,7 @@ def api_response

# return the links that the resource has
def links
valid_link_keys = %w(mandate new_customer_bank_account organisation parent_event payment payout previous_customer_bank_account refund subscription )
valid_link_keys = %w(mandate new_customer_bank_account new_mandate organisation parent_event payment payout previous_customer_bank_account refund subscription )
valid_links = (@links || {}).select { |key, _| valid_link_keys.include?(key) }

links_class = Struct.new(
Expand All @@ -58,6 +58,8 @@ def links

new_customer_bank_account: '',

new_mandate: '',

organisation: '',

parent_event: '',
Expand Down
4 changes: 4 additions & 0 deletions spec/resources/event_spec.rb
Expand Up @@ -19,6 +19,8 @@

'new_customer_bank_account' => 'new_customer_bank_account-input',

'new_mandate' => 'new_mandate-input',

'organisation' => 'organisation-input',

'parent_event' => 'parent_event-input',
Expand Down Expand Up @@ -57,6 +59,8 @@

expect(resource.links.new_customer_bank_account).to eq('new_customer_bank_account-input')

expect(resource.links.new_mandate).to eq('new_mandate-input')

expect(resource.links.organisation).to eq('organisation-input')

expect(resource.links.parent_event).to eq('parent_event-input')
Expand Down

0 comments on commit 535ea22

Please sign in to comment.