Sha256: f58cfbde8fe613ad749d8d04ae7d838cdaa18b0656721b7bd6fc7dd97ec7daa1

Contents?: true

Size: 870 Bytes

Versions: 5

Compression:

Stored size: 870 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

5 entries across 5 versions & 1 rubygems

Version Path
mangopay-3.0.29 spec/mangopay/event_spec.rb
mangopay-3.0.28 spec/mangopay/event_spec.rb
mangopay-3.0.27 spec/mangopay/event_spec.rb
mangopay-3.0.26 spec/mangopay/event_spec.rb
mangopay-3.0.25.pre.alpha.pre.20 spec/mangopay/event_spec.rb