Sha256: a1d19762959e5cc460d1523121f6e5d3cef1abb4fc427c38d63f203e73228b16

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe 'PaymentMethod' do
  describe '.available' do
    subject { Spree::PaymentMethod.available(:front_end, store) }

    let!(:check_payment_method) { FactoryGirl.create :check_payment_method }
    let(:payment_method_store) { FactoryGirl.create :store, :payment_methods => [check_payment_method] }

    context "when store is not specified" do
      let(:store) { nil }

      it { is_expected.to include(check_payment_method) }
    end

    context "when store is specified" do
      let(:store) { payment_method_store }

      context "when store has payment methods" do
        let(:non_matching_check_payment_method) { FactoryGirl.create :check_payment_method }

        it { is_expected.to include(check_payment_method) }
        it { is_expected.not_to include(non_matching_check_payment_method) }
      end

      context "when store does not have payment_methods" do
        let(:payment_method_store) { FactoryGirl.create :store }

        it { is_expected.to include(check_payment_method) }
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_multi_domain-1.0.3 spec/models/spree/payment_method_spec.rb
solidus_multi_domain-1.0.1 spec/models/spree/payment_method_spec.rb
solidus_multi_domain-1.0.0 spec/models/spree/payment_method_spec.rb