Mangopay / mangopay2-ruby-sdk

Ruby Gem for MANGOPAY
https://rubygems.org/gems/mangopay
MIT License
42 stars 38 forks source link

Failing specs #26

Closed javiercr closed 9 years ago

javiercr commented 9 years ago

I've just cloned the project, run the specs and it seems 10 of them are failing right now:

mangopay2-ruby-sdk git:(master) rspec spec
.....................................FF.....FF...........FF.F......FFF........................

Failures:

  1) MangoPay::KycDocument CREATE PAGE accepts File instance
     Failure/Error: MangoPay::KycDocument.create_page(new_natural_user['Id'], new_document['Id'], file)
     MangoPay::ResponseError:
       One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error. File: The type of the file submitted could not be determined - please try using a different file type
     # ./lib/mangopay.rb:93:in `request'
     # ./lib/mangopay/kyc_document.rb:51:in `create_page'
     # ./spec/mangopay/kyc_document_spec.rb:72:in `create_page'
     # ./spec/mangopay/kyc_document_spec.rb:77:in `block (3 levels) in <top (required)>'

  2) MangoPay::KycDocument CREATE PAGE accepts base64-encoded string
     Failure/Error: MangoPay::KycDocument.create_page(new_natural_user['Id'], new_document['Id'], file)
     MangoPay::ResponseError:
       Internal Server Error
     # ./lib/mangopay.rb:93:in `request'
     # ./lib/mangopay/kyc_document.rb:51:in `create_page'
     # ./spec/mangopay/kyc_document_spec.rb:72:in `create_page'
     # ./spec/mangopay/kyc_document_spec.rb:83:in `block (3 levels) in <top (required)>'

  3) MangoPay::PayIn::Card::Direct REFUND refunds a payin
     Failure/Error: refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
     MangoPay::ResponseError:
       Internal Server Error
     # ./lib/mangopay.rb:93:in `request'
     # ./lib/mangopay/http_calls.rb:71:in `refund'
     # ./spec/mangopay/payin_card_direct_spec.rb:42:in `block (3 levels) in <top (required)>'

  4) MangoPay::PayIn::Card::Direct CASH FLOW changes balances correctly
     Failure/Error: refund = MangoPay::PayIn.refund(payin['Id'], {AuthorId: payin['AuthorId']})
     MangoPay::ResponseError:
       Internal Server Error
     # ./lib/mangopay.rb:93:in `request'
     # ./lib/mangopay/http_calls.rb:71:in `refund'
     # ./spec/mangopay/payin_card_direct_spec.rb:63:in `block (3 levels) in <top (required)>'

  5) MangoPay::PreAuthorization CREATE creates a new card pre-authorization
     Failure/Error: expect(created['Status']).to eq('SUCCEEDED')

       expected: "SUCCEEDED"
            got: "FAILED"

       (compared using ==)
     # ./spec/mangopay/preauthorization_spec.rb:14:in `block (3 levels) in <top (required)>'

  6) MangoPay::PreAuthorization UPDATE updates a card pre-authorization
     Failure/Error: updated = MangoPay::PreAuthorization.update(created['Id'] ,{
     MangoPay::ResponseError:
       One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error. PaymentStatus: PaymentSatus value has to be 'WAITING' to edit a PreAuthorization
     # ./lib/mangopay.rb:93:in `request'
     # ./lib/mangopay/http_calls.rb:20:in `update'
     # ./spec/mangopay/preauthorization_spec.rb:24:in `block (3 levels) in <top (required)>'

  7) MangoPay::Refund FETCH fetches a refund
     Failure/Error: resource = MangoPay::Transfer.refund(transfer['Id'], { AuthorId: transfer['AuthorId'] })
     MangoPay::ResponseError:
       Internal Server Error
     # ./lib/mangopay.rb:93:in `request'
     # ./lib/mangopay/http_calls.rb:71:in `refund'
     # ./spec/mangopay/refund_spec.rb:7:in `block (3 levels) in <top (required)>'

  8) MangoPay::Transfer CREATE creates a new Transfer
     Failure/Error: expect(trans['Status']).to eq('SUCCEEDED')

       expected: "SUCCEEDED"
            got: "FAILED"

       (compared using ==)
     # ./spec/mangopay/transfer_spec.rb:11:in `check_type_and_status'
     # ./spec/mangopay/transfer_spec.rb:21:in `block (3 levels) in <top (required)>'

  9) MangoPay::Transfer FETCH fetches a Transfer
     Failure/Error: expect(trans['Status']).to eq('SUCCEEDED')

       expected: "SUCCEEDED"
            got: "FAILED"

       (compared using ==)
     # ./spec/mangopay/transfer_spec.rb:11:in `check_type_and_status'
     # ./spec/mangopay/transfer_spec.rb:30:in `block (3 levels) in <top (required)>'

  10) MangoPay::Transfer REFUND refunds a transfer
     Failure/Error: refund = MangoPay::Transfer.refund(trans['Id'], {AuthorId: trans['AuthorId']})
     MangoPay::ResponseError:
       Internal Server Error
     # ./lib/mangopay.rb:93:in `request'
     # ./lib/mangopay/http_calls.rb:71:in `refund'
     # ./spec/mangopay/transfer_spec.rb:38:in `block (3 levels) in <top (required)>'

Finished in 7 minutes 36 seconds (files took 0.25313 seconds to load)
94 examples, 10 failures

Failed examples:

rspec ./spec/mangopay/kyc_document_spec.rb:75 # MangoPay::KycDocument CREATE PAGE accepts File instance
rspec ./spec/mangopay/kyc_document_spec.rb:81 # MangoPay::KycDocument CREATE PAGE accepts base64-encoded string
rspec ./spec/mangopay/payin_card_direct_spec.rb:40 # MangoPay::PayIn::Card::Direct REFUND refunds a payin
rspec ./spec/mangopay/payin_card_direct_spec.rb:54 # MangoPay::PayIn::Card::Direct CASH FLOW changes balances correctly
rspec ./spec/mangopay/preauthorization_spec.rb:6 # MangoPay::PreAuthorization CREATE creates a new card pre-authorization
rspec ./spec/mangopay/preauthorization_spec.rb:22 # MangoPay::PreAuthorization UPDATE updates a card pre-authorization
rspec ./spec/mangopay/refund_spec.rb:5 # MangoPay::Refund FETCH fetches a refund
rspec ./spec/mangopay/transfer_spec.rb:18 # MangoPay::Transfer CREATE creates a new Transfer
rspec ./spec/mangopay/transfer_spec.rb:26 # MangoPay::Transfer FETCH fetches a Transfer
rspec ./spec/mangopay/transfer_spec.rb:36 # MangoPay::Transfer REFUND refunds a transfer

Top 10 slowest examples (193.05 seconds, 42.3% of total time):
  MangoPay::PayIn::Card::Direct REFUND refunds a payin
    40.36 seconds ./spec/mangopay/payin_card_direct_spec.rb:40
  MangoPay::PayIn::Card::Direct CASH FLOW changes balances correctly
    37.77 seconds ./spec/mangopay/payin_card_direct_spec.rb:54
  MangoPay::Event FETCH accepts filtering params
    22.12 seconds ./spec/mangopay/event_spec.rb:8
  MangoPay::PayIn::PreAuthorized::Direct REFUND refunds a payin
    16.22 seconds ./spec/mangopay/payin_preauthorized_direct_spec.rb:40
  MangoPay::PayIn::PreAuthorized::Direct CASH FLOW changes balances correctly
    15.78 seconds ./spec/mangopay/payin_preauthorized_direct_spec.rb:54
  MangoPay::Transaction FETCH accepts filtering params
    13.93 seconds ./spec/mangopay/transaction_spec.rb:35
  MangoPay::Wallet FETCH TRANSACTIONS fetches list with two transactions after payin and payout done
    12.73 seconds ./spec/mangopay/wallet_spec.rb:48
  MangoPay::Wallet FETCH TRANSACTIONS accepts filtering params
    11.69 seconds ./spec/mangopay/wallet_spec.rb:61
  MangoPay::Transaction FETCH fetches list with two transactions after payin and payout done
    11.31 seconds ./spec/mangopay/transaction_spec.rb:22
  MangoPay::Transfer CASH FLOW changes balances correctly
    11.12 seconds ./spec/mangopay/transfer_spec.rb:51

Top 10 slowest example groups:
  MangoPay::PayIn::Card::Direct
    23.86 seconds average (95.43 seconds / 4 examples) ./spec/mangopay/payin_card_direct_spec.rb:1
  MangoPay::Event
    22.12 seconds average (22.12 seconds / 1 example) ./spec/mangopay/event_spec.rb:1
  MangoPay::PayIn::PreAuthorized::Direct
    13.46 seconds average (53.84 seconds / 4 examples) ./spec/mangopay/payin_preauthorized_direct_spec.rb:1
  MangoPay::Transfer
    10.18 seconds average (40.72 seconds / 4 examples) ./spec/mangopay/transfer_spec.rb:1
  MangoPay::Refund
    9.8 seconds average (9.8 seconds / 1 example) ./spec/mangopay/refund_spec.rb:1
  MangoPay::Transaction
    7.63 seconds average (30.54 seconds / 4 examples) ./spec/mangopay/transaction_spec.rb:1
  MangoPay::PayOut::BankWire
    7.58 seconds average (22.75 seconds / 3 examples) ./spec/mangopay/payout_bankwire_spec.rb:1
  MangoPay::PreAuthorization
    7.41 seconds average (22.23 seconds / 3 examples) ./spec/mangopay/preauthorization_spec.rb:1
  MangoPay::Wallet
    5.31 seconds average (37.14 seconds / 7 examples) ./spec/mangopay/wallet_spec.rb:1
  MangoPay::Client
    2.71 seconds average (8.12 seconds / 3 examples) ./spec/mangopay/client_spec.rb:1

I'd like to work on a PR to allow changing the Net:HTTP's timeout, but with the specs failing it's going to be hard to be sure I'm not breaking anything.

hobailey commented 9 years ago

Hi @javiercr, are your specs still failing with the latest version? Normally everything is updated and fixed now but do let me know if not.

javiercr commented 9 years ago

@hobailey all tests are passing now with the latest changes from master. Closing this, thanks!

hobailey commented 9 years ago

Great, thanks for the update :-)