Sha256: 1d9bf2b9c5afe31dc9b4100935ea3fecb67648e00df5d3cad5b15da5a5128571
Contents?: true
Size: 1.77 KB
Versions: 1
Compression:
Stored size: 1.77 KB
Contents
require 'spec_helper' describe Spree::Gateway::Linkpoint do let(:gateway) { described_class.create!(name: 'Linkpoint') } let(:provider) { double('provider') } let(:money) { double('money') } let(:credit_card) { double('credit_card') } let(:identification) { double('identification') } let(:options) { { subtotal: 3, discount: -1 } } before do gateway.provider_class.stub(new: provider) end context '.provider_class' do it 'is a Linkpoint gateway' do expect(gateway.provider_class).to eq ::ActiveMerchant::Billing::LinkpointGateway end end context '#authorize' do it 'adds the discount to the subtotal' do provider.should_receive(:authorize) .with(money, credit_card, subtotal: 2, discount: 0) gateway.authorize(money, credit_card, options) end end context '#purchase' do it 'adds the discount to the subtotal' do provider.should_receive(:purchase) .with(money, credit_card, subtotal: 2, discount: 0) gateway.purchase(money, credit_card, options) end end context '#capture' do let(:authorization) { double('authorization') } it 'adds the discount to the subtotal' do provider.should_receive(:capture) .with(money, authorization, subtotal: 2, discount: 0) gateway.capture(money, authorization, options) end end context '#void' do it 'adds the discount to the subtotal' do provider.should_receive(:void) .with(identification, subtotal: 2, discount: 0) gateway.void(identification, options) end end context '#credit' do it 'adds the discount to the subtotal' do provider.should_receive(:credit) .with(money, identification, subtotal: 2, discount: 0) gateway.credit(money, identification, options) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
spree_gateway-2.2.1 | spec/models/gateway/linkpoint_spec.rb |