Sha256: a3e4292c17f207c4ae396baeef112321e0c6991e8d5a1802f9d7b9062948a079

Contents?: true

Size: 965 Bytes

Versions: 16

Compression:

Stored size: 965 Bytes

Contents

# coding: UTF-8
require 'spec_helper'

describe Spree::Admin::StockMovementsHelper, :type => :helper do

  describe "#pretty_originator" do

    context "transfering between two locations" do
      let(:destination_location) { create(:stock_location_with_items) }
      let(:source_location) { create(:stock_location_with_items) }
      let(:stock_item) { source_location.stock_items.order(:id).first }
      let(:variant) { stock_item.variant }

      before do
        @stock_transfer = Spree::StockTransfer.create(reference: 'PO123')
        variants = { variant => 5 }
        @stock_transfer.transfer(source_location,
                       destination_location,
                       variants)
        helper.pretty_originator(@stock_transfer.stock_movements.last)
      end


      it "returns link to stock transfer" do
        expect(helper.pretty_originator(@stock_transfer.stock_movements.last)).to eq @stock_transfer.number
      end
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
spree_backend-3.1.5 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.4 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.3 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.2 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.0.10 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.1 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.0 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.0.rc4 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.0.9 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.0.rc3 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.0.rc2 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.1.0.rc1 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.0.8 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.0.7 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.0.6.1 spec/helpers/admin/stock_movements_helper_spec.rb
spree_backend-3.0.6 spec/helpers/admin/stock_movements_helper_spec.rb