Sha256: b935d89357a292f7cedc384a57f72c7f0b0bd4dc7a9cfc82f53b561c0bf327e7

Contents?: true

Size: 1.03 KB

Versions: 6

Compression:

Stored size: 1.03 KB

Contents

require 'rails_helper'

module Spree
  module SolidusSixSaferpay
    RSpec.describe InquirePayment do

      let(:payment) { create(:six_saferpay_payment, :authorized) }

      let(:service) { described_class.new(payment) }

      describe '.call' do
        it 'calls an initialized service with given order and payment method' do
          expect(described_class).to receive(:new).with(payment).and_return(service)
          expect(service).to receive(:call)

          described_class.call(payment)
        end
      end

      describe '#call' do
        it 'fails because gateway raises an error' do
          expect { service.call }.to raise_error(NotImplementedError)
        end
      end

      describe '#gateway' do
        it 'raises an error because the gateway must be defined in subclasses' do
          expect { service.gateway }.to raise_error(NotImplementedError)
        end
      end

      describe '#success?' do
        it 'is initially false' do
          expect(service).not_to be_success
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
solidus_six_saferpay-0.5.0 spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
solidus_six_saferpay-0.4.0 spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
solidus_six_saferpay-0.3.0 spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
solidus_six_saferpay-0.1.8.1 spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
solidus_six_saferpay-0.2.0 spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb
solidus_six_saferpay-0.1.8 spec/services/spree/solidus_six_saferpay/inquire_payment_spec.rb