spec/lib/mangopay/shared_resources.rb in mangopay-3.0.8 vs spec/lib/mangopay/shared_resources.rb in mangopay-3.0.9

- old
+ new

@@ -294,5 +294,22 @@ Fees: { Currency: 'EUR', Amout: 0}, Tag: 'Test transfer' }) end end + +############################################### +shared_context 'hooks' do +############################################### + let(:new_hook) { + hooks = MangoPay::Hook.fetch({'page' => 1, 'per_page' => 1}) + if hooks.length == 0 + MangoPay::Hook.create({ + EventType: 'PAYIN_NORMAL_CREATED', + Url: 'http://test.com', + Tag: 'Test hook' + }) + else + hooks[0] + end + } +end