<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/cucumber_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -5,25 +5,23 @@ end
 
 
 Given /^I have one user &quot;([^\&quot;]*)&quot; with password &quot;([^\&quot;]*)&quot;$/ do |login, password|
-    User.gen!(:login =&gt; login,
+    User.make(:login =&gt; login,
              :password =&gt; password,
              :password_confirmation =&gt; password)
 end
 
 Given /^I have one admin user &quot;([^\&quot;]*)&quot; with password &quot;([^\&quot;]*)&quot;$/ do |login, password|
-    User.gen!(:admin, :login =&gt; login,
+    User.make(:admin, :login =&gt; login,
              :password =&gt; password,
              :password_confirmation =&gt; password)
 end
 
 Given /^&quot;([^\&quot;]*)&quot; is project admin of &quot;([^\&quot;]*)&quot; project$/ do |login, project_name|
-  user = User.first(:login =&gt; login)
-  project = Project.first(:name =&gt; project_name)
-  member = Member.new(:user_id =&gt; user.id)
-  function = Function.first(:project_admin =&gt; true) ? Function.first(:project_admin =&gt; true) : Function.gen!(:admin)
-  member.function_id = function.id
-  member.project_id = project.id
-  member.save!
+  user = User.first(:conditions =&gt; {:login =&gt; login})
+  project = Project.first(:condtions =&gt; {:name =&gt; project_name})
+  function = Function.first(:conditions =&gt; {:project_admin =&gt; true}) ? Function.first(:conditions =&gt; {:project_admin =&gt; true}) : Function.make(:admin)
+  project.project_members &lt;&lt; ProjectMember.new(:user =&gt; user, :function =&gt; function)
+  project.save!
   user.should be_admin(project)
 end
 </diff>
      <filename>features/authentication/steps/login_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -27,16 +27,18 @@ Then /^the (.*) ?request should fail/ do |_|
 end
 
 Given /^I have a project &quot;([^\&quot;]*)&quot;$/ do |name|
-  unless Project.first(:name =&gt; name)
+  unless Project.first(:conditions =&gt; {:name =&gt; name})
     lambda do
-      Project.gen!(:name =&gt; name)
+      make_project(:name =&gt; name)
     end.should change(Project, :count)
   end
 end
 
 Given /^I have a project &quot;([^\&quot;]*)&quot; without members$/ do |name|
   Given %{I have a project &quot;#{name}&quot;}
-  Project.first(:name =&gt; name).members.each {|m| m.destroy}
+  pm = Project.first(:conditions =&gt; {:name =&gt; name})
+  pm.project_members = []
+  pm.save
 end
 
 Then /^&quot;([^\&quot;]*)&quot; &quot;([^\&quot;]*)&quot; &quot;([^\&quot;]*)&quot; doesn't exist$/ do |klass, attribute, value|
@@ -44,61 +46,53 @@ Then /^&quot;([^\&quot;]*)&quot; &quot;([^\&quot;]*)&quot; &quot;([^\&quot;]*)&quot; doesn't exist$/ do |klass, attribute, va
 end
 
 Given /^&quot;([^\&quot;]*)&quot; not admin on project &quot;([^\&quot;]*)&quot;$/ do |login, project_name|
-    project = Project.first(:name =&gt; project_name)
-    member = project.members('user.login' =&gt; login)
-    if !member.empty? &amp;&amp; member.project_admin?
-      member.function = Function.not_admin
-      member.save
-    end
+    project = Project.first(:conditions =&gt; {:name =&gt; project_name})
+    project.project_members.each {|pm|
+      if pm.user.login == login
+        pm.function = Function.not_admin
+      end
+    }
+    project.save
 end
 
 Given /^(\d+) tickets with state &quot;([^\&quot;]*)&quot; on project &quot;(.*)&quot;$/ do |num, state_name, project_name|
-  state = State.first(:name =&gt; state_name)
-  state = State.gen!(:name =&gt; state_name) unless state
-  project = Project.first(:name =&gt; project_name)
-  project = Project.gen(:name =&gt; project_name) unless project
+  state = State.first(:conditions =&gt; {:name =&gt; state_name}) || State.make(:conditions =&gt; {:name =&gt; state_name})
+  project = Project.first(:name =&gt; project_name) || Project.make(:conditions =&gt; {:name =&gt; project_name})
   num.to_i.times {
-     Ticket.gen(:state_id =&gt; state.id,
-               :project_id =&gt; project.id)
+     Ticket.make(:state =&gt; state,
+               :project =&gt; project)
   }
 end
 
 Given /^(\d+) tickets with state &quot;([^\&quot;]*)&quot; and tag &quot;([^\&quot;]*)&quot; on project &quot;([^\&quot;]*)&quot;$/ do |num, state_name, tag_name, project_name|
-  state = State.first(:name =&gt; state_name)
-  state = State.gen!(:name =&gt; state_name) unless state
-  project = Project.first(:name =&gt; project_name)
-  project = Project.gen(:name =&gt; project_name) unless project
+  state = State.first(:conditions =&gt; {:name =&gt; state_name}) || State.make(:name =&gt; state_name)
+  project = Project.first(:conditions =&gt; {:name =&gt; project_name}) || Project.make(:name =&gt; project_name)
   num.to_i.times {
-    Ticket.gen(:state_id =&gt; state.id,
-               :project_id =&gt; project.id,
+    Ticket.make(:state =&gt; state,
+               :project =&gt; project,
                :tag_list =&gt; tag_name)
   }
 end
 
 def user_with_name(name)
-  user = User.first(:login =&gt; name)
-  user = User.gen(:login =&gt; name) unless user
-  user
+  User.first(:conditions =&gt; {:login =&gt; name}) ||  User.make(:login =&gt; name)
 end
 
 def project_with_name(name)
-  project = Project.first(:name =&gt; name)
-  project = Project.gen(:name =&gt; name) unless project
-  project
+  Project.first(:conditions =&gt; {:name =&gt; name}) || Project.gen(:name =&gt; name)
 end
 
 def function_with_name(name)
-  function = Function.first(:name =&gt; name)
-  function = Function.gen(:name =&gt; name,
-                         :project_admin =&gt; (name == 'admin')) unless function
-  function
+  Function.first(:conditions =&gt; {:name =&gt; name}) || Function.make(:name =&gt; name,
+                         :project_admin =&gt; (name == 'admin'))
 end
 
 Given /^I have user &quot;([^\&quot;]*)&quot; with function &quot;([^\&quot;]*)&quot; on project &quot;([^\&quot;]*)&quot;$/ do |user_name, function_name, project_name|
   user = user_with_name(user_name)
   project = project_with_name(project_name)
   function = function_with_name(function_name)
-  member = project.members.create(:user =&gt; user, :function =&gt; function)
+  project.project_members &lt;&lt; ProjectMember.new(:user =&gt; user, :function =&gt; function)
+  project.save
 end
 
 Given /^I have user &quot;([^\&quot;]*)&quot; with function &quot;([^\&quot;]*)&quot; on project &quot;([^\&quot;]*)&quot; and no other user$/ do |user_name, function_name, project_name|
@@ -106,25 +100,24 @@ Given /^I have user &quot;([^\&quot;]*)&quot; with function &quot;([^\&quot;]*)&quot; on project &quot;([^\&quot;]*)&quot; an
 
   user = user_with_name(user_name)
   project = project_with_name(project_name)
-  project.members.all(:user_id.not =&gt; user.id).each { |m| m.destroy }
+  project.project_members.delete_if{ |pm| pm.user_id != user.id }
+  project.save!
 end
 
 Then /^the member &quot;([^\&quot;]*)&quot; has function &quot;([^\&quot;]*)&quot; in project &quot;([^\&quot;]*)&quot;$/ do |user_name, function_name, project_name|
-  User.first(:login =&gt; user_name).members.first(:project_id =&gt; Project.first(:name =&gt; project_name).id).function.name.should == function_name
-end
-
-When /transaction commit/ do
-  transaction = DataMapper.repository(:default).adapter.pop_transaction
-  transaction.commit
+  u = User.first(:conditions =&gt; {:login =&gt; user_name})
+  pr = Project.first(:conditions =&gt; {:name =&gt; project_name})
+  pr.project_members.should_not be_empty
+  pr.project_members.find{|pm| pm.user_id = u.id}
 end
 
 Given /^I have state &quot;([^\&quot;]*)&quot;$/ do |name|
-    State.gen(:name =&gt; name) if State.first(:name =&gt; name).nil?
+    State.make(:name =&gt; name) unless State.first(:conditions =&gt; {:name =&gt; name})
 end
 
 Then /^I have (\d+) ticket on project &quot;([^\&quot;]+)&quot;$/ do |num_ticket, project_name|
-  Project.all(:name =&gt; project_name).count.should == 1
-  Project.first(:name =&gt; project_name).tickets.count.should == num_ticket.to_i
+  Project.count(:name =&gt; project_name).should == 1
+  Project.first(:conditions =&gt; {:name =&gt; project_name}).tickets.count.should == num_ticket.to_i
 end
 
 Then /^I should see an? ([^\&quot;]*) message with &quot;([^\&quot;]*)&quot;$/ do |class_name, content|
@@ -140,8 +133,8 @@ Then /^I should see an? ([^\&quot;]*) message with child &quot;([^\&quot;]*)&quot;$/ do |class_name,
 end
 
 Given /^I create (\d+) ticket on project &quot;([^\&quot;]*)&quot;$/ do |number, project_name|
-  project = Project.first(:name =&gt; project_name)
+  project = Project.first(:conditions =&gt; {:name =&gt; project_name})
   number.to_i.times do
-    Ticket.gen(:project_id =&gt; project.id, :num =&gt; project.new_num_ticket)
+    Ticket.make(:project =&gt; project)
   end
 end</diff>
      <filename>features/steps/result_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ end
 require &quot;merb-core&quot;
 require &quot;spec&quot;
 require &quot;merb_cucumber/world/webrat&quot;
-require &quot;merb_cucumber/helpers/datamapper&quot;
+require 'spec/cucumber_helper'
 
 # Uncomment if you want transactional fixtures
 Merb::Test::World::Base.use_transactional_fixtures
@@ -19,6 +19,6 @@ Merb::Test::World::Base.use_transactional_fixtures
 # http://gist.github.com/37930
 def Spec.run? ; true; end
 
-Merb.start_environment(:testing =&gt; true, :adapter =&gt; 'runner', :environment =&gt; ENV['MERB_ENV'] || 'test')
+Merb.start_environment(:testing =&gt; true, :adapter =&gt; 'runner', :environment =&gt; ENV['MERB_ENV'] || 'cucumber')
   
-require File.join(File.dirname(__FILE__), '../../spec/fixtures.rb')
+require File.join(File.dirname(__FILE__), '../../spec/blueprints.rb')</diff>
      <filename>features/support/env.rb</filename>
    </modified>
    <modified>
      <diff>@@ -13,13 +13,13 @@ end
 Cucumber::Rake::Task.new(:features, &amp;cucumber_options)
 Cucumber::Rake::FeatureTask.new(:feature, &amp;cucumber_options)
 namespace :merb_cucumber do 
-  task :test_env do
-    Merb.start_environment(:environment =&gt; &quot;test&quot;, :adapter =&gt; 'runner')
+  task :env do
+    Merb.start_environment(:environment =&gt; &quot;cucumber&quot;, :adapter =&gt; 'runner')
   end
 end
 
 
-dependencies = ['merb_cucumber:test_env', 'db:automigrate']
+dependencies = ['merb_cucumber:env', 'db:drop']
 task :features =&gt; dependencies
 task :feature  =&gt; dependencies
 </diff>
      <filename>lib/tasks/cucumber.rake</filename>
    </modified>
    <modified>
      <diff>@@ -124,7 +124,6 @@ describe Ticket do
       @t = Ticket.make(:project =&gt; Project.first || make_project,
                        :tag_list =&gt; TAG_LIST,
                        :user_creator =&gt; Project.first.project_members.first.user)
-      @old_title = @t.title
       @old_description = @t.description
       @t.generate_update(@t.attributes.merge(ticket), 
                          Project.first.project_members.first.user)</diff>
      <filename>spec/models/ticket_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ade7a3a21465556adbec66e8e86adce6f9e8cf53</id>
    </parent>
  </parents>
  <author>
    <name>Cyril Mougel</name>
    <email>cyril.mougel@gmail.com</email>
  </author>
  <url>http://github.com/shingara/oupsnow/commit/5b558f920f1d554c895f30b9f83be8e8c020840b</url>
  <id>5b558f920f1d554c895f30b9f83be8e8c020840b</id>
  <committed-date>2009-09-15T12:04:50-07:00</committed-date>
  <authored-date>2009-09-15T12:04:50-07:00</authored-date>
  <message>start reuse cucumber with a drop_database on each scenario</message>
  <tree>47bcf342fb862613a8c84d4865c6cbd64b7c51d9</tree>
  <committer>
    <name>Cyril Mougel</name>
    <email>cyril.mougel@gmail.com</email>
  </committer>
</commit>
