Sha256: d45a44e5e66e2ceb70e638af752271ee09bd9f4351e8dd80c902194b997046fc

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe 'payment' do
  it 'can_return_its_requires_payment_method_status' do
    payment_intent = Stripe::PaymentIntent.new
    payment_intent.status = 'requires_payment_method'
    payment = Reji::Payment.new(payment_intent)
    expect(payment.requires_payment_method).to be true
  end

  it 'can_return_its_requires_action_status' do
    payment_intent = Stripe::PaymentIntent.new
    payment_intent.status = 'requires_action'
    payment = Reji::Payment.new(payment_intent)
    expect(payment.requires_action).to be true
  end

  it 'can_return_its_cancelled_status' do
    payment_intent = Stripe::PaymentIntent.new
    payment_intent.status = 'canceled'
    payment = Reji::Payment.new(payment_intent)
    expect(payment.cancelled?).to be true
  end

  it 'can_return_its_succeeded_status' do
    payment_intent = Stripe::PaymentIntent.new
    payment_intent.status = 'succeeded'
    payment = Reji::Payment.new(payment_intent)
    expect(payment.succeeded?).to be true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
reji-1.1.1 spec/unit/payment_spec.rb
reji-1.1.0 spec/unit/payment_spec.rb