Sha256: a8a79a62afc4f22e5b65aa754d5b48298752bebbb0fcc61d2a32314e015015e7

Contents?: true

Size: 1017 Bytes

Versions: 2

Compression:

Stored size: 1017 Bytes

Contents

class ShopOrdersDataset < Dataset::Base
  
  uses :shop_products
  
  def load
    create_record :shop_order, :empty
    create_record :shop_order, :one_item
    create_record :shop_order, :several_items
    
    create_record :shop_line_item, :crusty_bread, :item_id => shop_products(:crusty_bread).id, :item_type => 'ShopProduct'
    create_record :shop_line_item, :soft_bread,   :item_id => shop_products(:soft_bread).id, :item_type => 'ShopProduct'
    create_record :shop_line_item, :choc_milk,    :item_id => shop_products(:choc_milk).id, :item_type => 'ShopProduct'
    create_record :shop_line_item, :full_milk,    :item_id => shop_products(:full_milk).id, :item_type => 'ShopProduct'
    
    shop_orders(:one_item).line_items       << shop_line_items(:crusty_bread)
    
    shop_orders(:several_items).line_items  << shop_line_items(:soft_bread)
    shop_orders(:several_items).line_items  << shop_line_items(:choc_milk)
    shop_orders(:several_items).line_items  << shop_line_items(:full_milk)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
radiant-shop-extension-0.9.3 spec/datasets/shop_orders.rb
radiant-shop-extension-0.9.2 spec/datasets/shop_orders.rb