<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/controllers/products.rb</filename>
    </added>
    <added>
      <filename>app/helpers/application_helper.rb</filename>
    </added>
    <added>
      <filename>app/models/account.rb</filename>
    </added>
    <added>
      <filename>app/models/item.rb</filename>
    </added>
    <added>
      <filename>app/models/item/line_item.rb</filename>
    </added>
    <added>
      <filename>app/models/product.rb</filename>
    </added>
    <added>
      <filename>app/models/product/variation.rb</filename>
    </added>
    <added>
      <filename>app/models/shipping_info.rb</filename>
    </added>
    <added>
      <filename>app/models/transaction.rb</filename>
    </added>
    <added>
      <filename>app/models/upload.rb</filename>
    </added>
    <added>
      <filename>app/models/upload/image.rb</filename>
    </added>
    <added>
      <filename>app/models/upload/image/product_image.rb</filename>
    </added>
    <added>
      <filename>app/models/user/customer.rb</filename>
    </added>
    <added>
      <filename>app/models/weight.rb</filename>
    </added>
    <added>
      <filename>app/views/layout/merb_e_mart.html.erb</filename>
    </added>
    <added>
      <filename>app/views/products/_preview.html.haml</filename>
    </added>
    <added>
      <filename>app/views/products/index.html.haml</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/Rakefile</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/app/controllers/application.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/app/controllers/exceptions.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/app/helpers/global_helpers.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/app/views/exceptions/internal_server_error.html.erb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/app/views/exceptions/not_acceptable.html.erb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/app/views/exceptions/not_found.html.erb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/app/views/layout/application.html.erb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/autotest/discover.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/autotest/merb.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/autotest/merb_rspec.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/config/database.yml.sample</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/config/environments/development.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/config/environments/production.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/config/environments/rake.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/config/environments/test.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/config/init.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/config/rack.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/config/router.rb</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/public/images/merb.jpg</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/public/merb.fcgi</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/public/slices/merb-E-mart/javascripts/master.js</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/public/slices/merb-E-mart/stylesheets/master.css</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/public/stylesheets/master.css</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/spec/spec.opts</filename>
    </added>
    <added>
      <filename>examples/quick-E-mart/spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>lib/merb-E-mart.rb</filename>
    </added>
    <added>
      <filename>lib/merb-E-mart/exceptions/mixin_missing.rb</filename>
    </added>
    <added>
      <filename>lib/merb-E-mart/merbtasks.rb</filename>
    </added>
    <added>
      <filename>lib/merb-E-mart/upload_processor/static_file_processor.rb</filename>
    </added>
    <added>
      <filename>public/javascripts/master.js</filename>
    </added>
    <added>
      <filename>spec/merb-E-mart_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/account_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/item/line_item_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/item_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/shipping_info_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/transaction_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/upload/image/product_image_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/upload/image_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/upload_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/user/customer_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/weight_spec.rb</filename>
    </added>
    <added>
      <filename>spec/spec_fixtures.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,112 @@
-= merb_mart
-== Open-source e-commerce built on the Merb MVC Framework
+MerbEMart
+=========
+
+Please see also README.markdown.
+
+A slice for the Merb framework. 
+
+------------------------------------------------------------------------------
+
+Instructions for installation:
+
+file: config/init.rb
+
+# add the slice as a regular dependency
+
+dependency 'merb-E-mart'
+
+# if needed, configure which slices to load and in which order
+
+Merb::Plugins.config[:merb_slices] = { :queue =&gt; [&quot;MerbEMart&quot;, ...] }
+
+# optionally configure the plugins in a before_app_loads callback
+
+Merb::BootLoader.before_app_loads do
+  
+  Merb::Slices::config[:merb_E_mart] = { ... }
+  
+end
+
+file: config/router.rb
+
+# example: /merb-E-mart/:controller/:action/:id
+
+r.add_slice(:MerbEMart)
+
+# example: /foo/:controller/:action/:id
+
+r.add_slice(:MerbEMart, 'foo') # same as :path =&gt; 'foo'
+
+# example: /:lang/:controller/:action/:id (with :a param set)
+
+r.add_slice(:MerbEMart, :path =&gt; ':lang', :params =&gt; { :a =&gt; 'b' })
+
+# example: /:controller/:action/:id
+
+r.slice(:MerbEMart)
+
+Normally you should also run the following rake task:
+
+rake slices:merb_E_mart:install
+
+------------------------------------------------------------------------------
+
+You can put your application-level overrides in:
+
+host-app/slices/merb-E-mart/app - controllers, models, views ...
+
+Templates are located in this order:
+
+1. host-app/slices/merb-E-mart/app/views/*
+2. gems/merb-E-mart/app/views/*
+3. host-app/app/views/*
+
+You can use the host application's layout by configuring the
+merb-E-mart slice in a before_app_loads block:
+
+Merb::Slices.config[:merb_E_mart] = { :layout =&gt; :application }
+
+By default :merb_E_mart is used. If you need to override
+stylesheets or javascripts, just specify your own files in your layout
+instead/in addition to the ones supplied (if any) in 
+host-app/public/slices/merb-E-mart.
+
+In any case don't edit those files directly as they may be clobbered any time
+rake merb_E_mart:install is run.
+
+------------------------------------------------------------------------------
+
+About Slices
+================
+
+Merb-Slices is a Merb plugin for using and creating application 'slices' which
+help you modularize your application. Usually these are reuseable extractions
+from your main app. In effect, a Slice is just like a regular Merb MVC
+application, both in functionality as well as in structure.
+
+When you generate a Slice stub structure, a module is setup to serve as a
+namespace for your controller, models, helpers etc. This ensures maximum
+encapsulation. You could say a Slice is a mixture between a Merb plugin (a
+Gem) and a Merb application, reaping the benefits of both.
+
+A host application can 'mount' a Slice inside the router, which means you have
+full over control how it integrates. By default a Slice's routes are prefixed
+by its name (a router :namespace), but you can easily provide your own prefix
+or leave it out, mounting it at the root of your url-schema. You can even
+mount a Slice multiple times and give extra parameters to customize an
+instance's behaviour.
+
+A Slice's Application controller uses controller_for_slice to setup slice
+specific behaviour, which mainly affects cascaded view handling. Additionaly,
+this method is available to any kind of controller, so it can be used for
+Merb Mailer too for example.
+
+There are many ways which let you customize a Slice's functionality and
+appearance without ever touching the Gem-level code itself. It's not only easy
+to add template/layout overrides, you can also add/modify controllers, models
+and other runtime code from within the host application.
+
+To create your own Slice run this (somewhere outside of your merb app):
+
+$ merb-gen slice &lt;your-lowercase-slice-name&gt;
 
-Please see README.markdown.</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,29 +1,46 @@
-require 'rubygems'
-Gem.clear_paths
-Gem.path.unshift(File.join(File.dirname(__FILE__), &quot;gems&quot;))
-
-require 'rake'
-require 'rake/rdoctask'
-require 'rake/testtask'
+require 'rake/gempackagetask'
 require 'spec/rake/spectask'
-require 'fileutils'
-require 'merb-core'
-require 'rubigen'
-include FileUtils
+require 'merb-core/version'
+require 'merb-core/test/tasks/spectasks'
+
+PLUGIN = &quot;merb_e_mart&quot;
+NAME = &quot;merb_e_mart&quot;
+AUTHOR = &quot;Your Name&quot;
+EMAIL = &quot;Your Email&quot;
+HOMEPAGE = &quot;http://merbivore.com/&quot;
+SUMMARY = &quot;Merb Slice that provides ...&quot;
+VERSION = &quot;0.9.4&quot;
 
-# Load the basic runtime dependencies; this will include
-# any plugins and therefore plugin rake tasks.
-init_env = ENV['MERB_ENV'] || 'rake'
-Merb.load_dependencies(:environment =&gt; init_env)
+spec = Gem::Specification.new do |s|
+  s.name = NAME
+  s.version = VERSION
+  s.platform = Gem::Platform::RUBY
+  s.has_rdoc = true
+  s.extra_rdoc_files = [&quot;README&quot;, &quot;LICENSE&quot;, 'TODO']
+  s.summary = SUMMARY
+  s.description = s.summary
+  s.author = AUTHOR
+  s.email = EMAIL
+  s.homepage = HOMEPAGE
+  s.add_dependency('merb-slices', '&gt;= 0.9.4')
+  s.require_path = 'lib'
+  s.files = %w(LICENSE README Rakefile TODO) + Dir.glob(&quot;{lib,spec,app,public}/**/*&quot;)
+end
 
-# Get Merb plugins and dependencies
-Merb::Plugins.rakefiles.each { |r| require r }
+Rake::GemPackageTask.new(spec) do |pkg|
+  pkg.gem_spec = spec
+end
 
-desc &quot;start runner environment&quot;
-task :merb_env do
-  Merb.start_environment(:environment =&gt; init_env, :adapter =&gt; 'runner')
+desc &quot;Install MerbEMart as a gem&quot;
+task :install =&gt; [:package] do
+  sh %{sudo gem install pkg/#{NAME}-#{VERSION} --no-update-sources --local}
 end
 
-##############################################################################
-# ADD YOUR CUSTOM TASKS BELOW
-##############################################################################
+namespace :jruby do
+
+  desc &quot;Run :package and install the resulting .gem with jruby&quot;
+  task :install =&gt; :package do
+    sh %{#{SUDO} jruby -S gem install pkg/#{NAME}-#{VERSION}.gem --no-rdoc --no-ri}
+  end
+  
+end</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1 +1,14 @@
-= To-Do
+TODO:
+
+- Fix MerbEMart.description and MerbEMart.version
+- Fix LICENSE with your name
+- Fix Rakefile with your name and contact info
+- Add your code to lib/merb_e_mart.rb
+- Add your Merb rake tasks to lib/merb_e_mart/merbtasks.rb
+
+Remove anything that you don't need:
+
+- app/controllers/main.rb MerbEMart::Main controller
+- app/views/layout/merb_e_mart.html.erb
+- spec/controllers/main_spec.rb controller specs
+- public/* any public files</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,5 @@
-class Application &lt; Merb::Controller
+class MerbEMart::Application &lt; Merb::Controller
+  
+  controller_for_slice
+  
 end</diff>
      <filename>app/controllers/application.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,32 +2,23 @@
 # A generic representation of an Address.
 #
 class Address
-
   include DataMapper::Resource
 
-  property :id,           Integer, :serial =&gt; true
-  property :first_name,   String, :length =&gt; 50, :nullable =&gt; false
-  property :last_name,    String, :length =&gt; 50, :nullable =&gt; false
-  property :company,      String, :length =&gt; 100
-  property :telephone,    String, :length =&gt; 20
-  property :address1,     String, :length =&gt; 200, :nullable =&gt; false
-  property :address2,     String, :length =&gt; 200
-  property :city,         String, :length =&gt; 50
-  property :postal_code,  String, :length =&gt; 10
-  property :state_id,     Integer  # foreign-key
-  property :country_code, String  # foreign-key
+  property :id,           Integer,  :serial =&gt; true
+  property :first_name,   String,   :length =&gt; 50, :nullable =&gt; false
+  property :last_name,    String,   :length =&gt; 50, :nullable =&gt; false
+  property :company,      String,   :length =&gt; 100
+  property :telephone,    String,   :length =&gt; 20
+  property :address1,     String,   :length =&gt; 200, :nullable =&gt; false
+  property :address2,     String,   :length =&gt; 200
+  property :city,         String,   :length =&gt; 50
+  property :postal_code,  String,   :length =&gt; 10,  :nullable =&gt; false
+  property :state_id,     Integer   # foreign-key
+  property :country_code, String    # foreign-key
 
   belongs_to :state
-  belongs_to :country
-
-  validates_present :first_name
-  validates_present :last_name
-  validates_present :address1
-  validates_present :postal_code
-
-  validates_length :first_name, :maximum =&gt; 50
-  validates_length :last_name,  :maximum =&gt; 50
-  validates_length :address1,   :maximum =&gt; 255
+  belongs_to :country, :through =&gt; :state
+  belongs_to :customer
 
   alias :zipcode  :postal_code
   alias :zipcode= :postal_code=
@@ -39,3 +30,4 @@ class Address
   end
 
 end
+</diff>
      <filename>app/models/address.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,6 @@
 # ISO 3166-1 geographic code.
 #
 class Country
-
   include DataMapper::Resource
 
   property :code, String, :key =&gt; true, :length =&gt; 2     # ISO 3166-1 alpha-2
@@ -11,9 +10,6 @@ class Country
 
   has n, :states
 
-  validates_present   :name
-  validates_is_unique :name
-
   alias :provinces :states
 
 end</diff>
      <filename>app/models/country.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,41 +1,25 @@
-require &quot;bigdecimal&quot;
-require 'dm-validations'
-
-module Mart
-  class Order
-
-    include DataMapper::Resource
-
-    property :id,            Integer,  :serial =&gt; true
-    property :order_number,  Integer,  :default =&gt; 0,   :nullable =&gt; false, :index =&gt; :unique
-    property :created_on,    DateTime
-    property :shipped_on,    DateTime
-    property :notes,         DataMapper::Types::Text
-    property :referer,       String
-    property :product_cost,  BigDecimal,   :default =&gt; 0.0
-    property :shipping_cost, BigDecimal,   :default =&gt; 0.0
-    property :tax,           Float,        :default =&gt; 0.0, :nullable =&gt; false
-    property :billing_address_id, Integer      # foreign-key
-    property :shipping_address_id, Integer     # foreign-key
-    property :account_id,    Integer           # foreign-key
-    property :customer_id,   Integer           # foreign-key
-    property :order_shipping_type_id, Integer  # foreign-key
-    property :status_code_id,Integer           # foreign-key
-    property :promotion_id,  Integer           # foreign-key
-
-    has 1..n, :line_items,       :class_name =&gt; 'Orders::LineItem' #, :dependent =&gt; :destroy
-    has 1,    :billing_address,  :class_name =&gt; 'Address' #, :foreign_key =&gt; 'billing_address_id'
-    has 1,    :shipping_address, :class_name =&gt; 'Address' #, :foreign_key =&gt; 'shipping_address_id'
-
-    belongs_to :account
-    belongs_to :customer
-    belongs_to :order_shipping_type
-    belongs_to :status_code,     :class_name =&gt; 'Orders::StatusCode'
-    belongs_to :promotion
-
-    attr_accessor :promotion_code
-
-    validates_present :order_number
-
-  end
+class Order
+  include DataMapper::Resource
+
+  property :id,            Integer, :serial =&gt; true
+  property :order_number,  Integer, :nullable =&gt; false, :index =&gt; :unique
+  property :created_on,    DateTime
+  property :shipped_on,    DateTime
+  property :notes,         DM::Text
+  property :referer,       String
+  property :product_cost,  BigDecimal, :nullable =&gt; false
+  property :shipping_cost, BigDecimal, :nullable =&gt; false
+  property :tax,           BigDecimal, :nullable =&gt; false
+  property :customer_id,            Integer     # foreign-key
+  property :order_shipping_type_id, Integer     # foreign-key
+  property :shipping_info_id,       Integer     # foreign-key
+  property :promotion_id,           Integer     # foreign-key
+
+  belongs_to  :customer
+  belongs_to  :shipping_info
+
+  has 1..n,   :line_items
+  has 1..n,   :transactions
+
+  validates_present :customer, :line_items, :shipping_info
 end</diff>
      <filename>app/models/order.rb</filename>
    </modified>
    <modified>
      <diff>@@ -11,7 +11,6 @@
 #   German Bundesland                 =&gt; Baden-W&#252;rttemburg/BW
 #
 class State
-
   include DataMapper::Resource
 
   property :country_code, String, :key =&gt; true  # foreign-key, ISO 3166-1 alpha-2
@@ -19,5 +18,4 @@ class State
   property :name,         String,               :length =&gt; 50, :nullable =&gt; false
 
   belongs_to :country
-
 end</diff>
      <filename>app/models/state.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,85 +1,7 @@
-require 'digest/sha1'
-require &quot;date&quot;
-require &quot;dm-aggregates&quot;
-require &quot;dm-validations&quot;
-begin
-  require File.join(File.dirname(__FILE__), '..', '..', &quot;lib&quot;, &quot;authenticated_system&quot;, &quot;authenticated_dependencies&quot;)
-rescue
-  nil
-end
 class User
-
   include DataMapper::Resource
-  include AuthenticatedSystem::Model
-
-  attr_accessor :password, :password_confirmation
-
-  property :id,                         Integer,   :serial =&gt; true
-  property :login,                      String,    :unique =&gt; true
-  property :email,                      String
-  property :crypted_password,           String
-  property :salt,                       String
-  property :activation_code,            String
-  property :activated_at,               DateTime
-  property :remember_token_expires_at,  DateTime
-  property :remember_token,             String
-  property :created_at,                 DateTime
-  property :updated_at,                 DateTime
-
-  validates_length        :login,                   :within =&gt; 3..40
-  validates_is_unique     :login
-  validates_present       :email
-  validates_format        :email,                   :as =&gt; :email_address
-  validates_length        :email,                   :within =&gt; 3..100
-  validates_is_unique     :email
-  validates_present       :password,                :if =&gt; lambda { |r| r.password_required? }
-  validates_present       :password_confirmation,   :if =&gt; lambda { |r| r.password_required? }
-  validates_length        :password,                :within =&gt; 4..40, :if =&gt; lambda { |r| r.password_required? }
-  validates_is_confirmed  :password#,                :groups =&gt; :create
-
-  before :save,   :encrypt_password
-
-  before :create do
-    #User.make_activation_code
-  end
-  
-  after :create do
-    #User.send_signup_notification
-  end
-
-  def login=(value)
-    @login = value.downcase unless value.nil?
-  end
-
-  EMAIL_FROM = &quot;info@mysite.com&quot;
-  SIGNUP_MAIL_SUBJECT = &quot;Welcome to MYSITE.  Please activate your account.&quot;
-  ACTIVATE_MAIL_SUBJECT = &quot;Welcome to MYSITE&quot;
-
-  # Activates the user in the database
-  def activate
-    @activated = true
-    self.activated_at = Time.now.utc
-    self.activation_code = nil
-    save
-
-    # send mail for activation
-    UserMailer.dispatch_and_deliver(  :activation_notification,
-                                  {   :from =&gt; User::EMAIL_FROM,
-                                      :to   =&gt; self.email,
-                                      :subject =&gt; User::ACTIVATE_MAIL_SUBJECT },
-
-                                      :user =&gt; self )
-
-  end
-
-  #def send_signup_notification
-  #  UserMailer.dispatch_and_deliver(
-  #      :signup_notification,
-  #    { :from =&gt; User::EMAIL_FROM,
-  #      :to  =&gt; self.email,
-  #      :subject =&gt; User::SIGNUP_MAIL_SUBJECT },
-  #      :user =&gt; self
-  #  )
-  #end
 
+  property :id, Integer, :serial =&gt; true
+  property :username,      String, :length =&gt; 50, :nullable =&gt; false, :unique =&gt; true
+  property :created_on,    DateTime
 end</diff>
      <filename>app/models/user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,119 +1,2 @@
-body {
-  font-family: Arial, Verdana, sans-serif;
-  font-size: 12px;
-  background-color: #fff;
-}
-* {
-  margin: 0px;
-  padding: 0px;
-  text-decoration: none;
-}
-html {
-  height: 100%;
-  margin-bottom: 1px;
-}
-#container {
-  width: 80%;
-  text-align: left;
-  background-color: #fff;
-  margin-right: auto;
-  margin-left: auto;
-}
-#header-container {
-  width: 100%;
-  padding-top: 15px;
-}
-#header-container h1, #header-container h2 {
-  margin-left: 6px;
-  margin-bottom: 6px;
-}
-.spacer {
-  width: 100%;
-  height: 15px;
-}
-hr {
-  border: 0px;
-  color: #ccc;
-  background-color: #cdcdcd;
-  height: 1px;
-  width: 100%;
-  text-align: left;
-}
-h1 {
-  font-size: 28px;
-  color: #c55;
-  background-color: #fff;
-  font-family: Arial, Verdana, sans-serif;
-  font-weight: 300;
-}
-h2 {
-  font-size: 15px;
-  color: #999;
-  font-family: Arial, Verdana, sans-serif;
-  font-weight: 300;
-  background-color: #fff;
-}
-h3 {
-  color: #4d9b12;
-  font-size: 15px;
-  text-align: left;
-  font-weight: 300;
-  padding: 5px;
-  margin-top: 5px;
-}
-
-#left-container {
-  float: left;
-  width: 250px;
-  background-color: #FFFFFF;
-  color: black;
-}
-
-#left-container h3 {
-  color: #c55;
-}
-
-#main-container {
-  margin: 5px 5px 5px 260px;
-  padding: 15px;
-  border-left: 1px solid silver;
-  min-height: 400px;
-}
-p {
-  color: #000;
-  background-color: #fff;
-  line-height: 20px;
-  padding: 5px;
-}
-a {
-  color: #4d9b12;
-  background-color: #fff;
-  text-decoration: none;
-}
-a:hover {
-  color: #4d9b12;
-  background-color: #fff;
-  text-decoration: underline;
-}
-#footer-container {
-  clear: both;
-  font-size: 12px;
-  font-family: Verdana, Arial, sans-serif;
-}
-.right {
-  float: right;
-  font-size: 100%;
-  margin-top: 5px;
-  color: #999;
-  background-color: #fff;
-}
-.left {
-  float: left;
-  font-size: 100%;
-  margin-top: 5px;
-  color: #999;
-  background-color: #fff;
-}
-#main-container ul {
-  margin-left: 3.0em;
-}
\ No newline at end of file
+html, body { margin: 0; padding: 0; }
+#container { width: 800px; margin: 4em auto; padding: 4em 4em 6em 4em; background: #DDDDDD; }</diff>
      <filename>public/stylesheets/master.css</filename>
    </modified>
    <modified>
      <diff>@@ -2,6 +2,10 @@ require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;spec_helper&quot; )
 
 describe Address do
 
+  before(:each) do
+    DataMapper.auto_migrate!
+  end
+
   describe &quot;associations&quot; do
     it &quot;should belong to a country&quot; do
       address = Address.new
@@ -24,64 +28,45 @@ describe Address do
     end
   end
 
-  it &quot;should require a zip, telephone, last name, first name and address&quot; do
-    address = Address.new
-    address.valid?
-    address.errors.on(:first_name).should_not be_nil
-    address.errors.on(:last_name).should_not be_nil
-    address.errors.on(:address1).should_not be_nil
-    address.errors.on(:postal_code).should_not be_nil
-    address.first_name = &quot;John&quot;
-    address.last_name = &quot;Doe&quot;
-    address.address1 = &quot;1012 E 87th St&quot;
-    address.postal_code = &quot;10021&quot;
-    address.should be_valid
+  it &quot;should require a postal_code, last name, first name and address&quot; do
+    Address.create(Address.gen_attrs.except(:postal_code)).should_not be_valid
+    Address.create(Address.gen_attrs.except(:last_name)).should_not be_valid
+    Address.create(Address.gen_attrs.except(:first_name)).should_not be_valid
+    Address.create(Address.gen_attrs.except(:address1)).should_not be_valid
   end
 
   it &quot;should provide the zipcode alias for postal code&quot; do
-    address1 = Address.new
-    address1.postal_code = &quot;91210&quot;
-    address1.zipcode.should == &quot;91210&quot;
-    address2 = Address.new
-    address2.zipcode = &quot;10004&quot;
-    address2.postal_code.should == &quot;10004&quot;
+    address = Address.gen
+    address.zipcode.should == address.postal_code
   end
 
   it &quot;should limit the first name to be a maximum of 50 characters&quot; do
-    address = Address.new
     [3,50].each do |num|
-      address.first_name = &quot;a&quot; * num
-      address.valid?
-      address.errors.on(:first_name).should be_nil
+      Address.gen(:first_name =&gt; &quot;a&quot; * num).should be_valid
     end
 
-    address.first_name = &quot;a&quot; * 51
-    address.valid?
-    address.errors.on(:first_name).should_not be_nil
+    Address.gen(:first_name =&gt; &quot;a&quot; * 51).should_not be_valid
   end
 
   it &quot;should limit the last name to be a maximum of 50 characters&quot; do
-    address = Address.new
     [3,50].each do |num|
-      address.last_name = &quot;z&quot; * num
-      address.valid?
-      address.errors.on(:last_name).should be_nil
+      Address.gen(:last_name =&gt; &quot;a&quot; * num).should be_valid
     end
 
-    address.last_name = &quot;z&quot; * 51
-    address.valid?
-    address.errors.on(:last_name).should_not be_nil
+    Address.gen(:last_name =&gt; &quot;a&quot; * 51).should_not be_valid
   end
 
-  it &quot;should limit the address to a maximum of 255 characters&quot;
+  it &quot;should limit the address to a maximum of 200 characters&quot; do
+    [3,200].each do |num|
+      Address.gen(:address1 =&gt; &quot;a&quot; * num).should be_valid
+    end
+
+    Address.gen(:address1 =&gt; &quot;a&quot; * 201).should_not be_valid
+  end
 
   #it &quot;should not allow PO Box or variants to be entered as an address&quot;
 
   it &quot;should provide a name&quot; do
-    address = Address.new
-    address.first_name = &quot;John&quot;
-    address.last_name = &quot;Doe&quot;
-    address.name.should == &quot;John Doe&quot;
+    Address.gen(:first_name =&gt; 'John', :last_name =&gt; 'Doe').name.should == 'John Doe'
   end
-
 end</diff>
      <filename>spec/models/address_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,54 +2,33 @@ require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;spec_helper&quot; )
 
 describe Country do
 
+  before(:each) do
+    DataMapper.auto_migrate!
+    @country = Country.gen
+  end
+
   describe &quot;associations&quot; do
     it &quot;should have many (0..*) states&quot; do
-      country = Country.new
-      country.should respond_to(:states)
+      @country.should respond_to(:states)
+      @country.states.each do |state|
+        state.country.should == @country
+      end
     end
 
     it &quot;should have many (0..*) provinces (alias for states)&quot; do
-      country = Country.new
-      country.should respond_to(:provinces)
+      @country.should respond_to(:provinces)
     end
   end
 
-  before(:each) do
-    @country = Country.new
-    Country.auto_migrate!
-  end
-
-  it &quot;should be valid&quot; do
-    @country.code = &quot;AD&quot;
-    @country.name = &quot;Andorra&quot;
-    @country.should be_valid
+  it &quot;should be valid when all attributes are supplied&quot; do
+    Country.gen.should be_valid
   end
 
   it &quot;should have a name field&quot; do
-    @country.valid?
-    @country.errors.on(:name).should_not be_nil
+    Country.create(Country.gen_attrs.except(:name)).should_not be_valid
   end
 
   it &quot;should have a unique name field&quot; do
-    country1 = Country.new(:code =&gt; &quot;FR&quot;, :name =&gt; &quot;France&quot;)
-    country2 = Country.new(:code =&gt; &quot;ZZ&quot;, :name =&gt; &quot;France&quot;)
-    country1.save.should be_true
-    country1.name = &quot;France&quot;
-    country2.valid?
-    # see http://wm.lighthouseapp.com/projects/4819/tickets/272-invalid-resources-still-save
-    #country2.save.should be_false
-    pending
-    country2.errors.on(:name).should_not be_nil
-  end
-
-  it &quot;should have a code field&quot; do
-    @country.name = &quot;Lithuania&quot;
-    @country.code = &quot;LT&quot;
-    @country.should be_valid
-  end
-
-  describe &quot;finders&quot; do
-
-  end
+    Country.create(Country.gen_attrs.merge(:name =&gt; @country.name)).should_not be_valid
 
 end</diff>
      <filename>spec/models/country_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,116 +1,69 @@
-require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;..&quot;, &quot;spec_helper&quot; )
-
-describe Mart::Order do
+require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;spec_helper&quot; )
 
+describe Order do
   before(:each) do
-    @order = Mart::Order.new
+    DataMapper.auto_migrate!
   end
 
   describe &quot;associations&quot; do
-    it &quot;should belong to account&quot; do
-      @order.should respond_to(:account)
-      @order.should respond_to(:account=)
-    end
-
     it &quot;should belong to a customer&quot; do
-      @order.should respond_to(:customer)
-      @order.should respond_to(:customer=)
+      customer = Customer.gen
+      order = Order.create(Order.gen_attrs.merge(:customer =&gt; customer))
+      order.customer.should == customer
+      order.should be_valid
+
+      order = Order.create(Order.gen_attrs.except(:customer))
+      order.customer.should be_nil
+      order.should_not be_valid
+      order.errors.should include(:customer)
     end
 
-    it &quot;should have many (1..*) line items&quot; do
-      @order.should respond_to(:line_items)
-      #@order.should respond_to(:line_items=)
-    end
+    it &quot;should have 1..n line_items&quot; do
+      line_items = (1..10).of {LineItem.gen}
+      order = Order.create(Order.gen_attrs.merge(:line_items =&gt; line_items))
+      order.line_items.should == line_items
+      order.should be_valid
 
-    it &quot;should have at least one line item&quot;
-
-    it &quot;should have a billing address&quot; do
-      @order.should respond_to(:billing_address)
-      @order.should respond_to(:billing_address=)
+      order = Order.create(Order.gen_attrs.except(:line_items))
+      order.line_items.should be_empty
+      order.should_not be_valid
+      order.errors.should include(:line_items)
     end
 
-    it &quot;should have a shipping address&quot; do
-      @order.should respond_to(:shipping_address)
-      @order.should respond_to(:shipping_address=)
-    end
+    it &quot;should have 1..n transactions&quot; do
+      transactions = (1..10).of {Transaction.gen}
+      order = Order.create(Order.gen_attrs.merge(:transactions =&gt; transactions))
+      order.transactions.should == transactions
+      order.should be_valid
 
-    it &quot;may belong to a promotion&quot; do
-      @order.should respond_to(:promotion)
-      @order.should respond_to(:promotion=)
+      order = Order.create(Order.gen_attrs.except(:transactions))
+      order.transactions.should be_empty
+      order.should be_valid
     end
 
-  end
-
-  it &quot;should be valid&quot; do
-    @order.order_number = 23
-    @order.should be_valid
-  end
-
-  it &quot;should have a total&quot;
-
-  describe &quot;class methods&quot; do
+    it &quot;should have 1 shipping info&quot; do
+      shipping_info = ShippingInfo.gen
+      order = Order.create(Order.gen_attrs.merge(:shipping_info =&gt; shipping_info))
+      order.shipping_info.should == shipping_info
+      order.should be_valid
 
-    it &quot;should return a search result&quot; do
-      pending
+      order = Order.create(Order.gen_attrs.except(:shipping_info))
+      order.shipping_info.should be_nil
+      order.should_not be_valid
+      order.errors.should include(:shipping_info)
     end
 
-    it &quot;should generate an order number&quot; do
-      #Mart::Order.generate_order_number
-      pending
-      Mart::Order.should respond_to(:generate_order_number)
-      
-    end
-
-    it &quot;should get totals&quot;
+    it &quot;should have 0..1 promotion&quot; do
+      pending &quot;many to many in DM core&quot;
 
-    it &quot;should get CSV for orders&quot; do
-      order1 = Mart::Order.new
-      order2 = Mart::Order.new
-      order_list = Array.new
-      #order_list &lt;&lt; [order1, order2]
-      order_list &lt;&lt; Mart::Order.new
-      order_list &lt;&lt; Mart::Order.new
-      order_list.should_not == nil
-      #@csv = Mart::Order.get_csv_for_orders(order_list)
-      pending
-    end
+      promotion = Promotion.gen
+      order = Order.create(Order.gen_attrs.merge(:promotion =&gt; promotion))
+      order.promotion.should == promotion
+      order.should be_valid
 
-    it &quot;should get XML for orders&quot; do
-      order1 = Mart::Order.new
-      order2 = Mart::Order.new
-      order_list = Array.new
-      order_list &lt;&lt; Mart::Order.new
-      order_list &lt;&lt; Mart::Order.new
-      order_list.should_not == nil
-      #@xml = Mart::Order.get_xml_for_orders(order_list)
-      pending
+      order = Order.create(Order.gen_attrs.except(:promotion))
+      order.promotion.should be_nil
+      order.should be_valid
     end
-
-    it &quot;should get order status&quot;
-
   end
-
-  it &quot;should assign line items from a hash&quot;
-
-  it &quot;should get the total amount of all line items associated with this order&quot;
-
-  it &quot;should test weight&quot;
-
-  #it &quot;should connect to FedEx to get shipping prices&quot;
-
-  it &quot;should work for a valid transaction&quot;
-  it &quot;should not work for an invalid transaction&quot;
-
-  #it &quot;should clean up&quot;
-  #it &quot;should not cleanup&quot;
-
-
-  it &quot;should have a shipping type&quot;
-
-  it &quot;should have a order status code&quot;
-
-  it &quot;should belong to a promotion&quot;
-
-  it &quot;should have a unique order number&quot;
-
 end</diff>
      <filename>spec/models/order_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,10 +2,16 @@ require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;spec_helper&quot; )
 
 describe State do
 
+  before(:each) do
+    DataMapper.auto_migrate!
+    @state = State.gen
+  end
+
   describe &quot;associations&quot; do
     it &quot;should belong to a country&quot; do
-      state = State.new
+      state = State.gen
       state.should respond_to(:country)
+      state.country.states.should include(state)
       state.should respond_to(:country=)
       state.should respond_to(:country_code)
     end
@@ -39,4 +45,4 @@ describe State do
     bremen.name.should == &quot;Bremen&quot;
   end
 
-end
+end
\ No newline at end of file</diff>
      <filename>spec/models/state_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,351 +1,13 @@
 require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;spec_helper&quot; )
-require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;user_spec_helper&quot;)
-require File.join( File.dirname(__FILE__), &quot;..&quot;, &quot;authenticated_system_spec_helper&quot;)
 
 describe User do
-  include UserSpecHelper
-
-  before(:each) do
-    User.clear_database_table
-    UserMailer.stub!(:activation_notification).and_return(true)
-  end
-
-  it &quot;should have a login field&quot; do
-    user = User.new
-    user.should respond_to(:login)
-    user.valid?
-    user.errors.on(:login).should_not be_nil
-  end
-
-  it &quot;should fail login if there are less than 3 chars&quot; do
-    user = User.new
-    user.login = &quot;AB&quot;
-    user.valid?
-    user.errors.on(:login).should_not be_nil
-  end
-
-  it &quot;should not fail login with between 3 and 40 chars&quot; do
-    user = User.new
-    [3,40].each do |num|
-      user.login = &quot;a&quot; * num
-      user.valid?
-      user.errors.on(:login).should be_nil
-    end
-  end
-
-  it &quot;should fail login with over 90 chars&quot; do
-    user = User.new
-    user.login = &quot;A&quot; * 41
-    user.valid?
-    user.errors.on(:login).should_not be_nil
-  end
-
-  it &quot;should make a valid user&quot; do
-    user = User.new(valid_user_hash)
-    user.save
-    user.errors.should be_empty
-
-  end
-
-  it &quot;should make sure login is unique&quot; do
-    user = User.new( valid_user_hash.with(:login =&gt; &quot;Daniel&quot;) )
-    user2 = User.new( valid_user_hash.with(:login =&gt; &quot;Daniel&quot;))
-    user.save.should be_true
-    user.login = &quot;Daniel&quot;
-    # see http://wm.lighthouseapp.com/projects/4819/tickets/272-invalid-resources-still-save
-    #user2.save.should be_false
-    user2.errors.on(:login).should_not be_nil
-  end
-
-  it &quot;should make sure login is unique regardless of case&quot; do
-    User.first(:login =&gt; &quot;Daniel&quot;).should be_nil
-    user = User.new( valid_user_hash.with(:login =&gt; &quot;Daniel&quot;) )
-    user2 = User.new( valid_user_hash.with(:login =&gt; &quot;daniel&quot;))
-    user.save.should be_true
-    user.login = &quot;Daniel&quot;
-    # see http://wm.lighthouseapp.com/projects/4819/tickets/272-invalid-resources-still-save
-    #user2.save.should be_false
-    user2.errors.on(:login).should_not be_nil
-  end
-
-  it &quot;should downcase logins&quot; do
-    user = User.new( valid_user_hash.with(:login =&gt; &quot;DaNieL&quot;))
-    user.login.should == &quot;daniel&quot;
-  end
-
-  it &quot;should authenticate a user using a class method&quot; do
-    user = User.new(valid_user_hash)
-    user.save
-    user.activate
-    User.authenticate(valid_user_hash[:login], valid_user_hash[:password]).should_not be_nil
-  end
-
-  it &quot;should not authenticate a user using the wrong password&quot; do
-    user = User.new(valid_user_hash)
-    user.save
-
-    user.activate
-    User.authenticate(valid_user_hash[:login], &quot;not_the_password&quot;).should be_nil
-  end
-
-  it &quot;should not authenticate a user using the wrong login&quot; do
-    user = User.create(valid_user_hash)
-
-    user.activate
-    User.authenticate(&quot;not_the_login&quot;, valid_user_hash[:password]).should be_nil
-  end
-
-  it &quot;should not authenticate a user that does not exist&quot; do
-    User.authenticate(&quot;i_dont_exist&quot;, &quot;password&quot;).should be_nil
-  end
-
-
-  it &quot;should send a please activate email&quot; do
-    user = User.new(valid_user_hash)
-    UserMailer.should_receive(:dispatch_and_deliver) do |action, mail_args, mailer_params|
-      action.should == :signup_notification
-      [:from, :to, :subject].each{ |f| mail_args.keys.should include(f)}
-      mail_args[:to].should == user.email
-      mailer_params[:user].should == user
-    end
-    user.save
-  end
-
-  it &quot;should not send a please activate email when updating&quot; do
-    user = User.new(valid_user_hash)
-    user.save
-    UserMailer.should_not_receive(:signup_notification)
-    user.login = &quot;not in the valid hash for login&quot;
-    user.save
-  end
-
-end
-
-describe User, &quot;the password fields for User&quot; do
-  include UserSpecHelper
-
   before(:each) do
-    User.clear_database_table
-    @user = User.new( valid_user_hash )
-    UserMailer.stub!(:activation_notification).and_return(true)
-  end
-
-  it &quot;should respond to password&quot; do
-    @user.should respond_to(:password)
-  end
-
-  it &quot;should respond to password_confirmation&quot; do
-    @user.should respond_to(:password_confirmation)
-  end
-
-  #it &quot;should have a protected password_required method&quot; do
-  #  @user.protected_methods.should include(&quot;password_required?&quot;)
-  #end
-
-  it &quot;should respond to crypted_password&quot; do
-    @user.should respond_to(:crypted_password)
-  end
-
-  it &quot;should require password if password is required&quot; do
-    user = User.new( valid_user_hash.without(:password))
-    user.stub!(:password_required?).and_return(true)
-    user.valid?
-    user.errors.on(:password).should_not be_nil
-    user.errors.on(:password).should_not be_empty
-  end
-
-  it &quot;should set the salt&quot; do
-    user = User.new(valid_user_hash)
-    user.salt.should be_nil
-    user.send(:encrypt_password)
-    user.salt.should_not be_nil
-  end
-
-  it &quot;should require the password on create&quot; do
-    user = User.new(valid_user_hash.without(:password))
-    user.save
-    user.errors.on(:password).should_not be_nil
-    user.errors.on(:password).should_not be_empty
-  end
-
-  it &quot;should require password_confirmation if the password_required?&quot; do
-    user = User.new(valid_user_hash.without(:password_confirmation))
-    user.save
-    (user.errors.on(:password) || user.errors.on(:password_confirmation)).should_not be_nil
-  end
-
-  it &quot;should fail when password is outside 4 and 40 chars&quot; do
-    [3,41].each do |num|
-      user = User.new(valid_user_hash.with(:password =&gt; (&quot;a&quot; * num)))
-      user.valid?
-      user.errors.on(:password).should_not be_nil
-    end
+    DataMapper.auto_migrate!
   end
 
-  it &quot;should pass when password is within 4 and 40 chars&quot; do
-    [4,30,40].each do |num|
-      user = User.new(valid_user_hash.with(:password =&gt; (&quot;a&quot; * num), :password_confirmation =&gt; (&quot;a&quot; * num)))
-      user.valid?
-      user.errors.on(:password).should be_nil
-    end
+  it &quot;should require a username&quot; do
+    user = User.create(User.gen_attrs.except(:username))
+    user.should_not be_valid
+    user.errors.should include(:username)
   end
-
-  it &quot;should authenticate against a password&quot; do
-    user = User.new(valid_user_hash)
-    user.save
-    user.should be_authenticated(valid_user_hash[:password])
-  end
-
-  it &quot;should not require a password when saving an existing user&quot; do
-    user = User.create(valid_user_hash)
-    user = User.first(:login =&gt; valid_user_hash[:login])
-    user.password.should be_nil
-    user.password_confirmation.should be_nil
-    user.login = &quot;some_different_login_to_allow_saving&quot;
-    (user.save).should be_true
-  end
-
-end
-
-describe User, &quot;activation&quot; do
-  include UserSpecHelper
-
-
-  before(:each) do
-    User.clear_database_table
-    @user = User.new(valid_user_hash)
-  end
-
-  it &quot;should have an activation_code as an attribute&quot; do
-    @user.attributes.keys.any?{|a| a.to_s == &quot;activation_code&quot;}.should_not be_nil
-  end
-
-  it &quot;should create an activation code on create&quot; do
-    @user.activation_code.should be_nil
-    @user.save
-    @user.activation_code.should_not be_nil
-  end
-
-  it &quot;should not be active when created&quot; do
-    @user.should_not be_activated
-    @user.save
-    @user.should_not be_activated
-  end
-
-  it &quot;should respond to activate&quot; do
-    @user.should respond_to(:activate)
-  end
-
-  it &quot;should activate a user when activate is called&quot; do
-    @user.should_not be_activated
-    @user.save
-    @user.activate
-    @user.should be_activated
-    ## FIXME
-    #User.first(:login =&gt; valid_user_hash[:login]).should be_activated
-  end
-
-  it &quot;should should show recently activated when the instance is activated&quot; do
-    @user.should_not be_recently_activated
-    @user.activate
-    @user.should be_recently_activated
-  end
-
-  it &quot;should not show recently activated when the instance is fresh&quot; do
-    @user.activate
-    @user = nil
-    ## FIXME
-    #User.first(:login =&gt; valid_user_hash[:login]).should_not be_recently_activated
-  end
-
-  it &quot;should send out a welcome email to confirm that the account is activated&quot; do
-    @user.save
-    UserMailer.should_receive(:dispatch_and_deliver) do |action, mail_args, mailer_params|
-      action.should == :activation_notification
-      mail_args.keys.should include(:from)
-      mail_args.keys.should include(:to)
-      mail_args.keys.should include(:subject)
-      mail_args[:to].should == @user.email
-      mailer_params[:user].should == @user
-    end
-    @user.activate
-  end
-
-end
-
-describe User, &quot;remember_me&quot; do
-  include UserSpecHelper
-
-  predicate_matchers[:remember_token] = :remember_token?
-
-  before do
-    User.clear_database_table
-    @user = User.new(valid_user_hash)
-  end
-
-  it &quot;should have a remember_token_expires_at attribute&quot; do
-    @user.attributes.keys.any?{|a| a.to_s == &quot;remember_token_expires_at&quot;}.should_not be_nil
-  end
-
-  it &quot;should respond to remember_token?&quot; do
-    @user.should respond_to(:remember_token?)
-  end
-
-  it &quot;should return true if remember_token_expires_at is set and is in the future&quot; do
-    @user.remember_token_expires_at = DateTime.now + 3600
-    @user.should remember_token
-  end
-
-  it &quot;should set remember_token_expires_at to a specific date&quot; do
-    time = DateTime.new(2009, 12, 25)
-    @user.remember_me_until(time)
-    @user.remember_token_expires_at.should == time
-  end
-
-  it &quot;should set the remember_me token when remembering&quot; do
-    time = Time.mktime(2009,12,25)
-    @user.remember_me_until(time)
-    @user.remember_token.should_not be_nil
-    @user.save.should
-    User.first(:login =&gt; valid_user_hash[:login]).remember_token.should_not be_nil
-  end
-
-  it &quot;should remember me for&quot; do
-    t = DateTime.now
-    DateTime.stub!(:now).and_return(t)
-    today = DateTime.now
-    remember_until = today + (2* Merb::Const::WEEK)
-    @user.remember_me_for( Merb::Const::WEEK * 2)
-    @user.remember_token_expires_at.should == (remember_until)
-  end
-
-  it &quot;should remember_me for two weeks&quot; do
-    t = DateTime.now
-    DateTime.stub!(:now).and_return(t)
-    @user.remember_me
-    @user.remember_token_expires_at.should == (DateTime.now + (2 * Merb::Const::WEEK ))
-  end
-
-  it &quot;should forget me&quot; do
-    @user.remember_me
-    @user.save
-    @user.forget_me
-    @user.remember_token.should be_nil
-    @user.remember_token_expires_at.should be_nil
-  end
-
-  it &quot;should persist the forget me to the database&quot; do
-    @user.remember_me
-    @user.save
-
-    @user = User.first(:login =&gt; valid_user_hash[:login])
-    @user.remember_token.should_not be_nil
-
-    @user.forget_me
-
-    @user = User.first(:login =&gt; valid_user_hash[:login])
-    @user.remember_token.should be_nil
-    @user.remember_token_expires_at.should be_nil
-  end
-
 end</diff>
      <filename>spec/models/user_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,65 @@
 require 'rubygems'
 require 'merb-core'
-require 'spec' # Satiates Autotest and anyone else not using the Rake tasks
+require 'spec'
+require 'data_mapper'
+require 'can_has_fixtures'
 
-Merb.start_environment(:testing =&gt; true, :adapter =&gt; 'runner', :environment =&gt; ENV['MERB_ENV'] || 'test')
+# Add the dependency in a before_app_loads hook
+Merb::BootLoader.before_app_loads { require(File.join(File.dirname(__FILE__), '..', 'lib', 'merb-E-mart')) }
+
+DataMapper.setup(:default, 'sqlite3::memory:')
+
+# Using Merb.root below makes sure that the correct root is set for
+# - testing standalone, without being installed as a gem and no host application
+# - testing from within the host application; its root will be used
+
+Merb.start_environment(
+  :testing =&gt; true, 
+  :adapter =&gt; 'runner', 
+  :environment =&gt; ENV['MERB_ENV'] || 'test',
+  :merb_root =&gt; Merb.root
+)
+
+module Merb
+  module Test
+    module SliceHelper
+      
+      # The absolute path to the current slice
+      def current_slice_root
+        @current_slice_root ||= File.expand_path(File.join(File.dirname(__FILE__), '..'))
+      end
+      
+      # Whether the specs are being run from a host application or standalone
+      def standalone?
+        not $SLICED_APP
+      end
+      
+    end
+  end
+end
 
 Spec::Runner.configure do |config|
   config.include(Merb::Test::ViewHelper)
   config.include(Merb::Test::RouteHelper)
   config.include(Merb::Test::ControllerHelper)
+  config.include(Merb::Test::SliceHelper)
+end
+
+require File.join(File.dirname(__FILE__), 'spec_fixtures')
+
+class Random
+  def country_code(options = {:used =&gt; true, :unique =&gt; true})
+    code = 2.of {('a'..'z').random}.to_s until satisfies?(code, options)
+    
+    @@used &lt;&lt; code if options[:used]
+    code
+  end
+  
+  def address
+    &quot;#{rand(100_000)} #{word(:max =&gt; 75)} #{%w[st rd ln ave pkwy].random}&quot;
+  end
+
+  def phone_number
+    &quot;#{(100..999).random}-#{(100..999).random}-#{(0..9999).random}&quot;
+  end
 end</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>eca5dfd9ce428a4e4dae7ccb5509e45a3c430c76</id>
    </parent>
    <parent>
      <id>8655c0decb32d4159161863dc96d882c6bc33f75</id>
    </parent>
  </parents>
  <author>
    <name>Alex Coles</name>
    <email>alexbcoles@mac.com</email>
  </author>
  <url>http://github.com/myabc/merb_mart/commit/41c6875ee35250446ecbf6c7d7d0876ad51780da</url>
  <id>41c6875ee35250446ecbf6c7d7d0876ad51780da</id>
  <committed-date>2008-05-31T06:08:19-07:00</committed-date>
  <authored-date>2008-05-31T06:08:19-07:00</authored-date>
  <message>Merge commit 'ben/master'

Conflicts:

	.gitignore
	README
	Rakefile
	TODO
	app/controllers/application.rb
	app/models/address.rb
	app/models/country.rb
	app/models/order.rb
	app/models/state.rb
	app/models/user.rb
	public/stylesheets/master.css
	spec/models/address_spec.rb
	spec/models/country_spec.rb
	spec/models/order_spec.rb
	spec/models/state_spec.rb
	spec/models/user_spec.rb
	spec/spec_helper.rb</message>
  <tree>c1fcc05e56d6ff972cb9af4afcc1f7087fd89f7c</tree>
  <committer>
    <name>Alex Coles</name>
    <email>alexbcoles@mac.com</email>
  </committer>
</commit>
