Sha256: eb1f64a4ae2a94cc6a2215f0b8a1f9d28598220161781b73591005c2a39cb694

Contents?: true

Size: 852 Bytes

Versions: 3

Compression:

Stored size: 852 Bytes

Contents

FactoryGirl.define do
  factory :shipping_method, :class => Spree::ShippingMethod do
    zone { |a| Spree::Zone.find_by_name('GlobalZone') || a.association(:global_zone) }
    name 'UPS Ground'
    calculator { Factory.build(:calculator) }
  end

  factory :free_shipping_method, :class => Spree::ShippingMethod do
    zone { |a| Spree::Zone.find_by_name('GlobalZone') || a.association(:global_zone) }
    name 'UPS Ground'
    calculator { Factory.build(:no_amount_calculator) }
  end

  factory :shipping_method_with_category, :class => Spree::ShippingMethod do
    zone { |a| Spree::Zone.find_by_name('GlobalZone') || a.association(:global_zone) }
    name 'UPS Ground'
    match_none nil
    match_one nil
    match_all nil
    association(:shipping_category, :factory => :shipping_category)
    calculator { Factory.build(:calculator) }
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_core-1.1.0 lib/spree/core/testing_support/factories/shipping_method_factory.rb
spree_core-1.1.0.rc2 lib/spree/core/testing_support/factories/shipping_method_factory.rb
spree_core-1.1.0.rc1 lib/spree/core/testing_support/factories/shipping_method_factory.rb