Sha256: 46f7f54194a0e9d6f61af62e3f93deb0098d4bebb614368ee23320997124bc3b

Contents?: true

Size: 615 Bytes

Versions: 6

Compression:

Stored size: 615 Bytes

Contents

require 'spec_helper'

module Spree
  module Stock
    describe ContentItem, type: :model do
      let(:variant) { build(:variant, weight: 25.0) }
      subject { ContentItem.new(build(:inventory_unit, variant: variant)) }

      context "#volume" do
        it "calculate the total volume of the variant" do
          expect(subject.volume).to eq variant.volume * subject.quantity
        end
      end

      context "#dimension" do
        it "calculate the total dimension of the variant" do
          expect(subject.dimension).to eq variant.dimension * subject.quantity
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
spree_core-3.0.10 spec/models/spree/stock/content_item_spec.rb
spree_core-3.0.9 spec/models/spree/stock/content_item_spec.rb
spree_core-3.0.8 spec/models/spree/stock/content_item_spec.rb
spree_core-3.0.7 spec/models/spree/stock/content_item_spec.rb
spree_core-3.0.6.1 spec/models/spree/stock/content_item_spec.rb
spree_core-3.0.6 spec/models/spree/stock/content_item_spec.rb