Sha256: 2132c5792a7c6941375e4d7065e8fb99e05520e2be5c328076bd19f4991332f5
Contents?: true
Size: 1.05 KB
Versions: 18
Compression:
Stored size: 1.05 KB
Contents
Spree::Sample.load_sample("addresses") orders = [] orders << Spree::Order.where( number: "R123456789", email: "spree@example.com").first_or_create! do |order| order.item_total = 150.95 order.adjustment_total = 150.95 order.total = 301.90 end orders << Spree::Order.where( number: "R987654321", email: "spree@example.com").first_or_create! do |order| order.item_total = 15.95 order.adjustment_total = 15.95 order.total = 31.90 order.shipping_address = Spree::Address.first order.billing_address = Spree::Address.last end unless orders[0].line_items.any? orders[0].line_items.new( variant: Spree::Product.find_by!(name: "Ruby on Rails Tote").master, quantity: 1, price: 15.99).save! end unless orders[1].line_items.any? orders[1].line_items.new( variant: Spree::Product.find_by!(name: "Ruby on Rails Bag").master, quantity: 1, price: 22.99).save! end orders.each(&:create_proposed_shipments) orders.each do |order| order.state = "complete" order.completed_at = Time.current - 1.day order.save! end
Version data entries
18 entries across 18 versions & 1 rubygems