Sha256: c81e573115a9c9e3fcb678a60f7b5701c3487deb47567dac71b28ba4651ed9e3

Contents?: true

Size: 830 Bytes

Versions: 14

Compression:

Stored size: 830 Bytes

Contents

require 'spec_helper'

describe Spree::ShippingMethod do
  let(:shipping_method) { create :shipping_method }
  let(:order) { create :order, :store => store }
  let(:store) { create :store }

  describe '.store_match?' do
    subject { shipping_method.store_match?(order) }

    context 'when store contains this shipping method' do
      before { store.shipping_methods << shipping_method }
      it { is_expected.to eq(true) }
    end

    context "when the store does not contain this shipping method" do
      context "when the store has no shipping methods" do
        it { is_expected.to eq(true) }
      end

      context "when the store has at least on shipping method" do
        before { store.shipping_methods << FactoryGirl.create(:shipping_method) }
        it { is_expected.to eq(false)}
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
solidus_multi_domain-1.5.0 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.4.3 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.4.2 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.4.1 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.4.0 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.3.0 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.2.0 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.1.3 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.1.2 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.1.1 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.0.3 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.1.0 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.0.1 spec/models/spree/shipping_method_decorator_spec.rb
solidus_multi_domain-1.0.0 spec/models/spree/shipping_method_decorator_spec.rb