Sha256: e4aea28390ca63e8d3be418f11a0b2d1e4b35e63ed773a98969dcc76fe166558

Contents?: true

Size: 511 Bytes

Versions: 7

Compression:

Stored size: 511 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :subscription_line_item, class: 'SolidusSubscriptions::LineItem' do
    subscribable_id { create(:variant, subscribable: true).id }
    quantity { 1 }
    interval_length { 1 }
    interval_units { :month }

    association :spree_line_item, factory: :line_item

    trait :with_subscription do
      transient do
        subscription_traits { [] }
      end

      subscription { association :subscription, *subscription_traits }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
solidus_subscriptions-2.0.2 lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb
solidus_subscriptions-2.0.1 lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb
solidus_subscriptions-2.0.0 lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb
solidus_subscriptions-1.1.0 lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb
solidus_subscriptions-1.0.1 lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb
solidus_subscriptions-1.0.0 lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb
solidus_subscriptions-1.0.0.rc1 lib/solidus_subscriptions/testing_support/factories/line_item_factory.rb