Skip to content

Instantly share code, notes, and snippets.

@futhr
Created August 2, 2013 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save futhr/6144289 to your computer and use it in GitHub Desktop.
Save futhr/6144289 to your computer and use it in GitHub Desktop.
A quick way to create sample data testing Spree extensions.
# in your code
binding.pry
# pry console
require 'factory_girl'
require 'spree/testing_support/factories' # spree core factories
FactoryGirl.find_definitions # extension factories
# orders
FactoryGirl.create :order_with_totals
FactoryGirl.create :order_with_line_items
FactoryGirl.create :completed_order_with_totals
FactoryGirl.create :order_ready_to_ship
FactoryGirl.create :shipped_order
# more ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment