Sha256: 24b3e51fde6627bc23d5459137fa80190be172aa2ebdd0f92df878e6bdf89af1

Contents?: true

Size: 930 Bytes

Versions: 39

Compression:

Stored size: 930 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
      eventDate = events[0]["Date"]
      resourceId=events[0]["ResourceId"]
      events = MangoPay::Event.fetch({'AfterDate' => eventDate - 1, 'BeforeDate' => eventDate + 1})
      expect(events).to be_kind_of(Array)
      expect(events.count).to be >= 1
      expect(events.count {|e| e['ResourceId'] == resourceId}).to be >= 1
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
mangopay-3.28.0 spec/mangopay/event_spec.rb
mangopay-3.27.0 spec/mangopay/event_spec.rb
mangopay-3.26.1 spec/mangopay/event_spec.rb
mangopay-3.26.0 spec/mangopay/event_spec.rb
mangopay-3.25.1 spec/mangopay/event_spec.rb
mangopay-3.25.0 spec/mangopay/event_spec.rb
mangopay-3.24.1 spec/mangopay/event_spec.rb
mangopay-3.24.0 spec/mangopay/event_spec.rb
mangopay-3.23.0 spec/mangopay/event_spec.rb
mangopay-3.22.0 spec/mangopay/event_spec.rb
mangopay-3.21.0 spec/mangopay/event_spec.rb
mangopay-3.20.0 spec/mangopay/event_spec.rb
mangopay-3.19.0 spec/mangopay/event_spec.rb
mangopay-3.18.0 spec/mangopay/event_spec.rb
mangopay-3.17.0 spec/mangopay/event_spec.rb
mangopay-3.16.0 spec/mangopay/event_spec.rb
mangopay-3.15.0 spec/mangopay/event_spec.rb
mangopay-3.14.0 spec/mangopay/event_spec.rb
mangopay-3.13.2 spec/mangopay/event_spec.rb
mangopay-3.12.0 spec/mangopay/event_spec.rb