Skip to content

Commit

Permalink
Add store to samples.
Browse files Browse the repository at this point in the history
  • Loading branch information
adammathys committed Jul 23, 2015
1 parent d10cd59 commit 78555a5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sample/db/samples/orders.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Spree::Sample.load_sample("addresses")
Spree::Sample.load_sample("stores")

payment_method = Spree::PaymentMethod::Check.first!
store = Spree::Store.first!

orders = []
orders << Spree::Order.create!(
Expand Down Expand Up @@ -33,6 +35,7 @@

orders.each do |order|
order.payments.create!(payment_method: payment_method)
order.update_attributes(store: store)

order.next! while !order.can_complete?
order.complete!
Expand Down
6 changes: 6 additions & 0 deletions sample/db/samples/stores.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Spree::Store.create!(
name: "Sample Store",
code: "sample-store",
url: "solidus.example.com",
mail_from_address: "[email protected]",
)

0 comments on commit 78555a5

Please sign in to comment.