Sha256: be3524a2dc5987c5f02b603277b1d750e4bcf095dc17effb1637e7245f22e59e

Contents?: true

Size: 941 Bytes

Versions: 2

Compression:

Stored size: 941 Bytes

Contents

require 'rails_helper'

module Spree
  module SolidusSixSaferpay
    RSpec.describe PaymentNotFoundHandler do

      let(:controller) { instance_double(SolidusSixSaferpay::CheckoutController) }
      let(:order) { instance_double(Spree::Order, number: "R12345678") }

      subject { described_class.new(controller_context: controller, order: order) }

      describe '.call' do
        it 'calls a new instance with given parameters' do
          expect(described_class).to receive(:new).with(controller_context: controller, order: order).and_return(subject)
          expect(subject).to receive(:call)

          described_class.call(controller_context: controller, order: order)
        end
      end

      describe '#call' do
        it 'informs about the error' do
          expect(::SolidusSixSaferpay::ErrorHandler).to receive(:handle).with(instance_of(StandardError))

          subject.call
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
solidus_six_saferpay-0.5.0 spec/services/spree/solidus_six_saferpay/payment_not_found_handler_spec.rb
solidus_six_saferpay-0.4.0 spec/services/spree/solidus_six_saferpay/payment_not_found_handler_spec.rb