bookmebus / spree_vpago

Spree extension for traditional redirect off site payment gateway in Cambodia
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Unable to run rspec #109

Closed theachoem closed 1 year ago

theachoem commented 1 year ago

Tested on Ruby version 2.7.6 & 3.2.0.

$ bundle exec rspec

Failures:

  1) Spree::Webhook::PaywaysController POST return redirects to order path if payment status updater is success
     Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:20:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:21:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:33:in `block (3 levels) in <top (required)>'

  2) Spree::Webhook::PaywaysController POST return redirects to checkout with state :payment path if payment status updater is failed
     Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:20:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:21:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:33:in `block (3 levels) in <top (required)>'

  3) Spree::Webhook::PaywaysController GET continue redirects to checkout with state :payment path if payment status updater is failed
     Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:57:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:58:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:70:in `block (3 levels) in <top (required)>'

  4) Spree::Webhook::PaywaysController GET continue redirects to order path if payment status updater is success
     Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:57:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:58:in `block (3 levels) in <top (required)>'
     # ./spec/controllers/spree/webhook/payways_controller_spec.rb:61:in `block (3 levels) in <top (required)>'

  5) Vpago::Payway::TransactionStatus#gateway_params #check_transaction_url returns correct url if endpoint is terminated with /
     Failure/Error: let(:order) { OrderWalkthrough.up_to(:payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:20:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:21:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:80:in `block (4 levels) in <top (required)>'

  6) Vpago::Payway::TransactionStatus#gateway_params #check_transaction_url add / and return correct url if endpoint is not terminated with /
     Failure/Error: let(:order) { OrderWalkthrough.up_to(:payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:20:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:21:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:87:in `block (4 levels) in <top (required)>'

  7) Vpago::Payway::TransactionStatus#gateway_params #checker_hmac returns base64 hmac without newline char \n
     Failure/Error: let(:order) { OrderWalkthrough.up_to(:payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:20:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:21:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:70:in `block (4 levels) in <top (required)>'

  8) Vpago::Payway::TransactionStatus#gateway_params #process server response status is not 200 returns failed with error_message to response body
     Failure/Error: let(:order) { OrderWalkthrough.up_to(:payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:20:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:21:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:55:in `block (5 levels) in <top (required)>'

  9) Vpago::Payway::TransactionStatus#gateway_params #process server response with status 200 returns failed if response payload has status != 0
     Failure/Error: let(:order) { OrderWalkthrough.up_to(:payment) }

     Psych::DisallowedClass:
       Tried to load unspecified class: BigDecimal
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:20:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:21:in `block (3 levels) in <top (required)>'
     # ./spec/lib/vpago/payway/transaction_status_spec.rb:40:in `block (5 levels) in <top (required)>'

  10) Vpago::Payway::TransactionStatus#gateway_params #process server response with status 200 returns success if response payload has status = 0
      Failure/Error: let(:order) { OrderWalkthrough.up_to(:payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/transaction_status_spec.rb:20:in `block (3 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/transaction_status_spec.rb:21:in `block (3 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/transaction_status_spec.rb:28:in `block (5 levels) in <top (required)>'

  11) Spree::Admin::PaymentPaywayCheckersController PUT update redirects to order path if payment status updater is success
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/controllers/spree/admin/payment_payway_checkers_controller_spec.rb:17:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_checkers_controller_spec.rb:18:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_checkers_controller_spec.rb:30:in `block (3 levels) in <top (required)>'

  12) Spree::Admin::PaymentPaywayCheckersController PUT update redirects to order path if payment status updater is false
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/controllers/spree/admin/payment_payway_checkers_controller_spec.rb:17:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_checkers_controller_spec.rb:18:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_checkers_controller_spec.rb:30:in `block (3 levels) in <top (required)>'

  13) Spree::Admin::PaymentPaywayQueriersController GET show redirects to order path if payment status updater is success
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/controllers/spree/admin/payment_payway_queriers_controller_spec.rb:17:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_queriers_controller_spec.rb:18:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_queriers_controller_spec.rb:30:in `block (3 levels) in <top (required)>'

  14) Spree::Admin::PaymentPaywayQueriersController GET show redirects to order path if payment status updater is false
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/controllers/spree/admin/payment_payway_queriers_controller_spec.rb:17:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_queriers_controller_spec.rb:18:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_queriers_controller_spec.rb:30:in `block (3 levels) in <top (required)>'

  15) Spree::Admin::PaymentPaywayMarkersController PUT update redirects to order path if payment status updater is success
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/controllers/spree/admin/payment_payway_markers_controller_spec.rb:17:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_markers_controller_spec.rb:18:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_markers_controller_spec.rb:30:in `block (3 levels) in <top (required)>'

  16) Spree::Admin::PaymentPaywayMarkersController PUT update requires update_reason
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/controllers/spree/admin/payment_payway_markers_controller_spec.rb:17:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_markers_controller_spec.rb:18:in `block (3 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_markers_controller_spec.rb:30:in `block (3 levels) in <top (required)>'

  17) Spree::Gateway::Payway#process transform payment state from checkout to processing
      Failure/Error: let(:order) { OrderWalkthrough.up_to( payment_state) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/models/spree/gateway/payway_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/models/spree/gateway/payway_spec.rb:9:in `block (2 levels) in <top (required)>'
      # ./spec/models/spree/gateway/payway_spec.rb:14:in `block (3 levels) in <top (required)>'

  18) Vpago::Payway::Checkout#gateway_params return hash of params for the gateway
      Failure/Error: let(:order) { OrderWalkthrough.up_to(:payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/checkout_spec.rb:8:in `block (3 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/checkout_spec.rb:18:in `block (3 levels) in <top (required)>'

  19) Vpago::Payway::PaymentRequestUpdater#call if check payway status is success set error_message to nil and invoke payment status marker
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:12:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:63:in `block (4 levels) in <top (required)>'

  20) Vpago::Payway::PaymentRequestUpdater#call if check payway status is success set error_message to nil and invoke payment status marker
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:12:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:37:in `block (4 levels) in <top (required)>'

  21) Vpago::Payway::PaymentRequestUpdater success? return false f error_message source is not nil
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:12:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:27:in `block (3 levels) in <top (required)>'

  22) Vpago::Payway::PaymentRequestUpdater success? return true if error_message is not nil?
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:12:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_request_updater_spec.rb:23:in `block (3 levels) in <top (required)>'

  23) Vpago::Payway::PaymentStatusMarker#complete_order! updates order state to be complete
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:11:in `block (2 levels) in <top (required)>'

  24) Vpago::Payway::PaymentStatusMarker#transition_to_paid! mark payment and order state to be complete
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:11:in `block (2 levels) in <top (required)>'

  25) Vpago::Payway::PaymentStatusMarker#complete_payment! marks payment state to completed
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:11:in `block (2 levels) in <top (required)>'

  26) Vpago::Payway::PaymentStatusMarker#update_payment_source status false update payment source status to failed and save error_message
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:11:in `block (2 levels) in <top (required)>'

  27) Vpago::Payway::PaymentStatusMarker#update_payment_source status true update payment source payment_status to success
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:11:in `block (2 levels) in <top (required)>'

  28) Vpago::Payway::PaymentStatusMarker#transition_to_failed! mark payment and order state to be complete
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:7:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:8:in `block (2 levels) in <top (required)>'
      # ./spec/lib/vpago/payway/payment_status_marker_spec.rb:11:in `block (2 levels) in <top (required)>'

  29) Spree::Wing::TransactionsController GET show when payment source and wing response available return success result
      Failure/Error: wing_payment_source.reload

      Psych::DisallowedClass:
        Tried to load unspecified class: ActiveSupport::HashWithIndifferentAccess
      # ./spec/controllers/spree/wing/transactions_controller_spec.rb:63:in `block (4 levels) in <top (required)>'

  30) Spree::Admin::PaymentPaywayBaseController Put update passes the validate order
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/controllers/spree/admin/payment_payway_base_controller_spec.rb:17:in `block (2 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_base_controller_spec.rb:18:in `block (2 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_base_controller_spec.rb:31:in `block (3 levels) in <top (required)>'

  31) Spree::Admin::PaymentPaywayBaseController Put update redirect to with error if order if complated
      Failure/Error: let(:order) { OrderWalkthrough.up_to( :payment) }

      Psych::DisallowedClass:
        Tried to load unspecified class: BigDecimal
      # ./spec/controllers/spree/admin/payment_payway_base_controller_spec.rb:17:in `block (2 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_base_controller_spec.rb:18:in `block (2 levels) in <top (required)>'
      # ./spec/controllers/spree/admin/payment_payway_base_controller_spec.rb:23:in `block (3 levels) in <top (required)>'
channainfo commented 1 year ago

@theachoem It seems like it is a problem with the ruby compatibility version. Can you try to run with the version of ruby we use in VTENH? probably you run on a different version. Let's add .ruby-version in the repo once we figure it out.

theachoem commented 1 year ago

@channainfo with Gemfile.lock, I am able to run spec on ruby 2.7.6.