Sha256: 82493044f28a82e02abd7899675c6ff0a7a944e7445e9744deb1ba837621960c

Contents?: true

Size: 415 Bytes

Versions: 15

Compression:

Stored size: 415 Bytes

Contents

Factory.sequence(:shipping_method_sequence) {|n| "ShippingMethod ##{n}"}

Factory.define(:shipping_method) do |record|
  record.calculator {|r| Factory(:calculator, :calculable => r.instance_eval{@instance}) }
  record.name { Factory.next(:shipping_method_sequence) } 

  # associations: 
  record.zone {Zone.global}
end

Factory.define :calculator, :class => Calculator::FlatRate do |f|
  f.preferred_amount 10
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
spree-0.11.4 test/factories/shipping_method_factory.rb
spree-0.11.3 test/factories/shipping_method_factory.rb
spree-0.11.2 test/factories/shipping_method_factory.rb
spree-0.11.1 test/factories/shipping_method_factory.rb
spree-0.11.0 test/factories/shipping_method_factory.rb
spree-0.10.2 test/factories/shipping_method_factory.rb
spree-0.10.1 test/factories/shipping_method_factory.rb
spree-0.10.0 test/factories/shipping_method_factory.rb
spree-0.10.0.beta test/factories/shipping_method_factory.rb
spree-enriquez-0.9.4 test/factories/shipping_method_factory.rb
spree-0.9.4 test/factories/shipping_method_factory.rb
spree-0.9.3 test/factories/shipping_method_factory.rb
spree-0.9.2 test/factories/shipping_method_factory.rb
spree-0.9.1 test/factories/shipping_method_factory.rb
spree-0.9.0 test/factories/shipping_method_factory.rb