Sha256: 5ba7751a21f085f1bc239d75315f0917d5b8bc3069573f389c1f56b655a0f3b3

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

RSpec.shared_examples "it uses the payment page gateway" do

  it_behaves_like "it has route access"

  describe '#gateway' do
    it 'configures the gateway urls correctly' do
      expect(::SolidusSixSaferpay::PaymentPageGateway).to receive(:new)

      subject.gateway
    end

    context 'when the gateway is configured correctly' do
      before do
        allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_CUSTOMER_ID").and_return("customer_id")
        allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_TERMINAL_ID").and_return("terminal_id")
        allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_USERNAME").and_return("username")
        allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_PASSWORD").and_return("password")
        allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_BASE_URL").and_return("base_url")
        allow(ENV).to receive(:fetch).with("SIX_SAFERPAY_CSS_URL").and_return("css_url")
      end

      it 'should return a PaymentPageGateway' do
        expect(subject.gateway).to be_a(::SolidusSixSaferpay::PaymentPageGateway)
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
solidus_six_saferpay-0.5.0 spec/support/uses_payment_page_gateway.rb
solidus_six_saferpay-0.4.0 spec/support/uses_payment_page_gateway.rb
solidus_six_saferpay-0.3.0 spec/support/uses_payment_page_gateway.rb
solidus_six_saferpay-0.1.8.1 spec/support/uses_payment_page_gateway.rb
solidus_six_saferpay-0.2.0 spec/support/uses_payment_page_gateway.rb
solidus_six_saferpay-0.1.8 spec/support/uses_payment_page_gateway.rb