Sha256: 6978758c0319c03d19ca4996fce314c1ce99e04140a571de2154e9358b7f9faf

Contents?: true

Size: 511 Bytes

Versions: 102

Compression:

Stored size: 511 Bytes

Contents

FactoryBot.define do
  factory :reimbursement, class: Spree::Reimbursement do
    transient do
      return_items_count { 1 }
    end

    customer_return { create(:customer_return_with_accepted_items, line_items_count: return_items_count) }

    before(:create) do |reimbursement, _evaluator|
      reimbursement.order ||= reimbursement.customer_return.order
      if reimbursement.return_items.empty?
        reimbursement.return_items = reimbursement.customer_return.return_items
      end
    end
  end
end

Version data entries

102 entries across 102 versions & 1 rubygems

Version Path
spree_core-4.10.1 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.10.0 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.9.0 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.8.3 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.8.2 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.7.3 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.6.6 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.5.5 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.0.9 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.1.15 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.2.7 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.3.3 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.4.1 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.5.4 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.6.5 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.7.2 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.7.1 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.6.4 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.7.0 lib/spree/testing_support/factories/reimbursement_factory.rb
spree_core-4.6.3 lib/spree/testing_support/factories/reimbursement_factory.rb