Sha256: 0f660eae4698ab8c66cdc2e1a54d9d4df0bd5605cb7140a7e81ccf0fd8d64342

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

require "spec_helper"

describe Spree::PaymentMethod::SisowBilling::SisowPaymentMethod, type: :model do
  subject { Spree::PaymentMethod::SisowBilling::Purchase.new(source) }
  let(:source) { double("Spree::SisowTransaction", status: "") }

  it { expect(subject.authorization).to be_nil }

  context "source status is Success" do
    before { allow(source).to receive(:status).and_return("Success") }
    it { expect(subject.success?).to be true }
    it { expect(subject.to_s).to match "Purchase" }
  end

  context "source status is expired" do
    before { allow(source).to receive(:status).and_return("expired") }
    it { expect(subject.success?).to be false }
    it { expect(subject.to_s).to eq "Payment failed" }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_billing_sisow-0.9.2 spec/models/spree/payment_method/sisow_billing/purchase_spec.rb
spree_billing_sisow-0.9.1 spec/models/spree/payment_method/sisow_billing/purchase_spec.rb