Sha256: 528b286e6b58635f264f97168b59d14e036a96d9c95d33aa4dc43e7fc1a9fa81

Contents?: true

Size: 582 Bytes

Versions: 5

Compression:

Stored size: 582 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :friendly_shipping_rate_discount, class: "SolidusFriendlyPromotions::ShippingRateDiscount" do
    amount { BigDecimal("-4.00") }
    shipping_rate
    promotion_action do
      promotion = create(:friendly_promotion, name: "10% off shipping!", customer_label: "10% off")
      ten_percent = SolidusFriendlyPromotions::Calculators::Percent.new(preferred_percent: 10)
      SolidusFriendlyPromotions::Actions::AdjustShipment.create!(promotion: promotion, calculator: ten_percent)
    end
    label { "10% off" }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_friendly_promotions-1.0.0 lib/solidus_friendly_promotions/testing_support/factories/friendly_shipping_rate_discount_factory.rb
solidus_friendly_promotions-1.0.0.rc.3 lib/solidus_friendly_promotions/testing_support/factories/friendly_shipping_rate_discount_factory.rb
solidus_friendly_promotions-1.0.0.rc.2 lib/solidus_friendly_promotions/testing_support/factories/friendly_shipping_rate_discount_factory.rb
solidus_friendly_promotions-1.0.0.rc.1 lib/solidus_friendly_promotions/testing_support/factories/friendly_shipping_rate_discount_factory.rb
solidus_friendly_promotions-1.0.0.pre lib/solidus_friendly_promotions/testing_support/factories/friendly_shipping_rate_discount_factory.rb