Sha256: 9ce3c6d725a3d6e61d3850ca537899bcd2f9357b78a2885780490ce6794a69ff

Contents?: true

Size: 1.1 KB

Versions: 10

Compression:

Stored size: 1.1 KB

Contents

Spree::Sample.load_sample("addresses")

orders = []
orders << Spree::Order.create!({
  :number => "R123456789",
  :email => "spree@example.com",
  :item_total => 150.95,
  :adjustment_total => 150.95,
  :total => 301.90,
  :shipping_address => Spree::Address.first,
  :billing_address => Spree::Address.last
}, :without_protection => true)

orders << Spree::Order.create!({
  :number => "R987654321",
  :email => "spree@example.com",
  :item_total => 15.95,
  :adjustment_total => 15.95,
  :total => 31.90,
  :shipping_address => Spree::Address.first,
  :billing_address => Spree::Address.last
}, :without_protection => true)

orders[0].line_items.create!({
  :variant => Spree::Product.find_by_name!("Ruby on Rails Tote").master,
  :quantity => 1,
  :price => 15.99
}, :without_protection => true)

orders[1].line_items.create!({
  :variant => Spree::Product.find_by_name!("Ruby on Rails Bag").master,
  :quantity => 1,
  :price => 22.99
}, :without_protection => true)

orders.each(&:create_proposed_shipments)

orders.each do |order|
  order.state = "complete"
  order.completed_at = Time.now - 1.day
  order.save!
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
spree_sample-2.0.13 db/samples/orders.rb
spree_sample-2.0.12 db/samples/orders.rb
spree_sample-2.0.11 db/samples/orders.rb
spree_sample-2.0.10 db/samples/orders.rb
spree_sample-2.0.9 db/samples/orders.rb
spree_sample-2.0.8 db/samples/orders.rb
spree_sample-2.0.7 db/samples/orders.rb
spree_sample-2.0.6 db/samples/orders.rb
spree_sample-2.0.5 db/samples/orders.rb
spree_sample-2.0.4 db/samples/orders.rb