Sha256: 6f6ad62e24848031c95b0166f3cc48463e05997715440d22dc135ad6dffb0476

Contents?: true

Size: 870 Bytes

Versions: 2

Compression:

Stored size: 870 Bytes

Contents

describe "Deprecated BillingIntegration" do
  before { Gem::Deprecate.skip, @original = true, Gem::Deprecate.skip }
  after { Gem::Deprecate.skip = @original }

  it "returns the an instance scoped to PaymentMethod instead" do
    payment_methods.each do |payment_method|
      subject = build_class("BillingIntegration", payment_method).new
      expect(subject).to be_a(build_class("PaymentMethod", payment_method))
    end
  end

  it "passes the attributes on to the new instantiation" do
    payment_methods.each do |payment_method|
      klass = build_class("BillingIntegration", payment_method)
      expect(klass.new(name: "foo").name).to eq "foo"
    end
  end

  def payment_methods
    %w(Ideal Bancontact Sofort)
  end

  def build_class(swappable_class, payment_method)
    "Spree::#{swappable_class}::SisowBilling::#{payment_method}".constantize
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
spree_billing_sisow-0.9.2 spec/models/spree/billing_integration_spec.rb
spree_billing_sisow-0.9.1 spec/models/spree/billing_integration_spec.rb