Sha256: 8c449201563d1c56a8eea02937f405b15696475d2581c9b653cbc7bd04656f83

Contents?: true

Size: 901 Bytes

Versions: 12

Compression:

Stored size: 901 Bytes

Contents

describe MangoPay::Event do

  include_context 'payins'
  include_context 'payouts'

  describe 'FETCH' do

    it 'accepts filtering params' do

      # let's have at least 2 events
      payin = new_payin_card_direct
      create_new_payout_bankwire(payin)

      # get all
      events = MangoPay::Event.fetch()
      expect(events).to be_kind_of(Array)
      expect(events.count).to be >= 2

      # only one per page
      events = MangoPay::Event.fetch({'per_page' => 1})
      expect(events).to be_kind_of(Array)
      expect(events.count).to eq 1

      # filter by date
      events = MangoPay::Event.fetch({'AfterDate' => payin['CreationDate'], 'BeforeDate' => payin['CreationDate']})
      expect(events).to be_kind_of(Array)
      expect(events.count).to be >= 1
      expect(events.count { |e| e['ResourceId'] == payin['Id'] }).to be >= 1
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mangopay-3.0.25 spec/mangopay/event_spec.rb
mangopay-3.0.23 spec/mangopay/event_spec.rb
mangopay-3.0.21 spec/mangopay/event_spec.rb
mangopay-3.0.20 spec/mangopay/event_spec.rb
mangopay-3.0.19 spec/mangopay/event_spec.rb
mangopay-3.0.18 spec/mangopay/event_spec.rb
mangopay-3.0.17 spec/mangopay/event_spec.rb
mangopay-3.0.16 spec/mangopay/event_spec.rb
mangopay-3.0.15 spec/mangopay/event_spec.rb
mangopay-3.0.14 spec/mangopay/event_spec.rb
mangopay-3.0.13 spec/mangopay/event_spec.rb
mangopay-3.0.12 spec/mangopay/event_spec.rb