Sha256: 2d580b5a4e6c8ad300918fa020121a78e6d552a6b2fd4da7c434f10b7c9886f2
Contents?: true
Size: 691 Bytes
Versions: 24
Compression:
Stored size: 691 Bytes
Contents
# frozen_string_literal: true FactoryBot.define do factory :return_item, class: 'Spree::ReturnItem' do association(:inventory_unit, factory: :inventory_unit, state: :shipped) association(:return_reason, factory: :return_reason) return_authorization do |_return_item| build(:return_authorization, order: inventory_unit.order) end factory :exchange_return_item do after(:build) do |return_item| # set track_inventory to false to ensure it passes the in_stock check return_item.inventory_unit.variant.update_column(:track_inventory, false) return_item.exchange_variant = return_item.inventory_unit.variant end end end end
Version data entries
24 entries across 24 versions & 1 rubygems