<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>features/step_definitions/signup_steps.rb</filename>
    </added>
    <added>
      <filename>spec/factories.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -47,7 +47,7 @@ config.after_initialize do
 end
 
 config.gem &quot;flexmock&quot;
-config.gem &quot;ZenTest&quot;
+config.gem &quot;ZenTest&quot;, :lib =&gt; &quot;zentest&quot;
 config.gem &quot;hpricot&quot;
 config.gem &quot;hoe&quot;
 
@@ -55,4 +55,5 @@ config.gem &quot;hoe&quot;
 # the rspec.task file
 config.gem &quot;rspec-rails&quot;, :lib =&gt; false, :version =&gt; &quot;&gt;=1.2.2&quot;
 config.gem &quot;webrat&quot;, :lib =&gt; false, :version =&gt; &quot;&gt;=0.4.3&quot;
-config.gem &quot;cucumber&quot;, :lib =&gt; false, :version =&gt; &quot;&gt;=0.2.2&quot;
+config.gem &quot;cucumber&quot;, :lib =&gt; false, :version =&gt; &quot;&gt;=0.3.0&quot;
+config.gem &quot;thoughtbot-factory_girl&quot;, :lib =&gt; &quot;factory_girl&quot;, :source =&gt; &quot;http://gems.github.com&quot;</diff>
      <filename>config/environments/test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,30 +3,34 @@ Feature: Signup new users
   In order to be able to administer Tracks
   As a user who just installed Tracks
   I want to create an admin account
+
+  Background:
+    Given the following user records
+      | login    | password | is_admin |
+      | testuser | secret   | false    |
+      | admin    | secret   | true     |
   
   Scenario: Successful signup
     Given no users exists
     When I go to the homepage
     Then I should be redirected to the signup page
-    When I successfully submit the signup form
+    When I submit the signup form with username &quot;admin&quot;, password &quot;secret&quot; and confirm with &quot;secret&quot;
     Then I should be on the homepage
     And I should be an admin
     
   Scenario: Signup should be refused when password and confirmation is not the same
     Given no users exists
     When I go to the signup page
-    And I submit signup form with dissimmilar password and confirmation
+    And I submit the signup form with username &quot;admin&quot;, password &quot;secret&quot; and confirm with &quot;error&quot;
     Then I should be redirected to the signup page
     And I should see &quot;Password doesn't match confirmation&quot;
     
   Scenario: With public signups turned off, signup should be refused when an admin user exists
     Given public signups are turned off
-    And an admin user exists
     When I go to the signup page
     Then I should see &quot;You don't have permission to sign up for a new account.&quot;
     
   Scenario: With public signups turned on, signup should possible when an admin user exists
     Given public signups are turned on
-    And an admin user exists
     When I go to the signup page
     Then I should see &quot;Sign up a new user&quot;    
\ No newline at end of file</diff>
      <filename>features/create_admin.feature</filename>
    </modified>
    <modified>
      <diff>@@ -3,23 +3,24 @@ Feature: Existing user logging in
   In order to keep my things private
   As an existing user
   I want to log in with my username and password
-  
-  Scenario: Succesfull login
-    Given an admin user exists
-    When I go to the login page
-    And I successfully submit the login form as an admin user
-    Then I should be redirected to the home page
-    And I should see &quot;Login successful&quot;
-    
-  Scenario: Unsuccesfull login
-    Given an admin user exists
+
+  Background:
+    Given the following user records
+      | login    | password | is_admin |
+      | testuser | secret   | false    |
+      | admin    | secret   | true     |
+
+  Scenario Outline: Succesfull and unsuccesfull login
     When I go to the login page
-    And I submit the login form as an admin user with an incorrect password
-    Then I should be on the login page
-    And I should see &quot;Login unsuccessful&quot;
+    And I submit the login form as user &quot;&lt;user&gt;&quot; with password &quot;&lt;password&gt;&quot;
+    Then I should be &lt;there&gt;
+    And I should see &quot;&lt;message&gt;&quot;
+
+    Examples:
+    | user  | password | there                       | message            |
+    | admin | secret   | redirected to the home page | Login successful   |
+    | admin | wrong    | on the login page           | Login unsuccessful |
 
   Scenario: Accessing a secured page when not logged in
-    Given an admin user exists
     When I go to the home page
-    Then I should be redirected to the login page
-    
\ No newline at end of file
+    Then I should be redirected to the login page    
\ No newline at end of file</diff>
      <filename>features/logging_in.feature</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,22 @@
 Feature Show statistics
   In order to see what I have got done
   As an user
-  I want see my statistic
+  I want see my statistics
+
+  Background:
+    Given the following user record
+      | login    | password | is_admin |
+      | testuser | secret   | false    |
 
   Scenario: Show statistics with no history
-    Given I am logged in
+    Given I have logged in as &quot;testuser&quot; with password &quot;secret&quot;
     And I have no todos
     When I go to the statistics page
     Then I should see &quot;Totals&quot;
     And I should see &quot; More statistics will appear here once you have added some actions.&quot;
 
   Scenario: Show statistics with history
-    Given I am logged in
+    Given I have logged in as &quot;testuser&quot; with password &quot;secret&quot;
     And I have 5 todos
     And I have 2 deferred todos
     And I have 2 completed todos
@@ -27,7 +32,7 @@ Feature Show statistics
     And I should see &quot;Tags&quot;
     
   Scenario: Click through to see chart of all actions per month
-    Given I am logged in
+    Given I have logged in as &quot;testuser&quot; with password &quot;secret&quot;
     And I have 5 todos
     When I go to the statistics page
     And I click on the chart for actions done in the last 12 months
@@ -35,7 +40,7 @@ Feature Show statistics
     And I should see &quot;to return to the statistics page&quot;
     
   Scenario: Click through to see all incomplete actions of a week
-    Given I am logged in
+    Given I have logged in as &quot;testuser&quot; with password &quot;secret&quot;
     And I have 5 todos
     And I have 2 deferred todos
     When I go to the statistics page
@@ -47,7 +52,7 @@ Feature Show statistics
     And I should see &quot;to show the actions from week 0 and further&quot;
 
   Scenario: Click through to see all incomplete visible actions of a week
-    Given I am logged in
+    Given I have logged in as &quot;testuser&quot; with password &quot;secret&quot;
     And I have 5 todos
     And I have 3 deferred todos
     When I go to the statistics page</diff>
      <filename>features/show_statistics.feature</filename>
    </modified>
    <modified>
      <diff>@@ -1,69 +1,14 @@
-Given /^I am logged in$/ do
-  @current_user = User.create!(:login =&gt; &quot;testuser&quot;, :password =&gt; &quot;secret&quot;, :password_confirmation =&gt; &quot;secret&quot;)
-  @current_user.create_preference
+Given /^I have logged in as &quot;(.*)&quot; with password &quot;(.*)&quot;$/ do |username, password|
   visit login_path
-  fill_in &quot;login&quot;, :with =&gt; &quot;testuser&quot;
-  fill_in &quot;password&quot;, :with =&gt; &quot;secret&quot;
+  fill_in &quot;login&quot;, :with =&gt; username
+  fill_in &quot;password&quot;, :with =&gt; password
   click_button &quot;Sign in&quot;
   response.body.should =~ /Login successful/m
+  @current_user = User.find_by_login(username)
 end
 
-Given /^public signups are turned (.*)$/ do |state|
-  case state 
-  when 'on'
-    SITE_CONFIG['open_signups'] = true
-  when 'off'
-    SITE_CONFIG['open_signups'] = false
-  else
-    raise &quot;public signups should be either 'on' or 'off'&quot;
-  end
-end
-
-When &quot;I successfully submit the signup form&quot; do
-  fill_in 'Desired login', :with =&gt; 'reinier'
-  fill_in 'Choose password', :with =&gt; 'abracadabra'
-  fill_in 'Confirm password', :with =&gt; 'abracadabra'
-  click_button
-end
-
-When &quot;I submit signup form with dissimmilar password and confirmation&quot; do
-  fill_in 'Desired login', :with =&gt; 'reinier'
-  fill_in 'Choose password', :with =&gt; 'abracadabra'
-  fill_in 'Confirm password', :with =&gt; 'somethingelse'
-  click_button
-end
-
-Then &quot;I should be an admin&quot; do
-  # just check on the presence of the menu item for managing users
-  Then &quot;I should see \&quot;Manage users\&quot;&quot;
-end
-
-When &quot;I submit the login form as an admin user with an incorrect password&quot; do
-  Given &quot;an admin user exists&quot;
-  fill_in 'Login', :with =&gt; 'admin'
-  fill_in 'Password', :with =&gt; 'incorrectpass'
+When /^I submit the login form as user &quot;([^\&quot;]*)&quot; with password &quot;([^\&quot;]*)&quot;$/ do |username, password|
+  fill_in 'Login', :with =&gt; username
+  fill_in 'Password', :with =&gt; password
   click_button
-end
-
-When &quot;I successfully submit the login form as an admin user&quot; do
-  Given &quot;an admin user exists&quot;
-  fill_in 'Login', :with =&gt; 'admin'
-  fill_in 'Password', :with =&gt; 'abracadabra'
-  click_button
-end
-
-When &quot;Reinier visits the site&quot; do
-  visits '/'
-end
-
-Then &quot;Reinier should see the tasks listing page&quot; do
-  response.should have_tag('title', /list tasks/i)
-end
-
-Then &quot;Reinier should see the login page again&quot; do
-  response.should have_tag('title', /login/i)
-end
-  
-Then &quot;Reinier should see the message Login unsuccessful&quot; do
-  should_see 'Login unsuccessful'
 end
\ No newline at end of file</diff>
      <filename>features/step_definitions/login_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,37 +1,15 @@
-Given &quot;no users exists&quot; do
-  User.delete_all
-end
-
-Given &quot;an admin user exists&quot; do
-  if @admin_user
-    @admin_user.destroy
+Given /^the following user records?$/ do |table|
+  table.hashes.each do |hash|
+    user = Factory(:user, hash)
+    user.create_preference
   end
-  @admin_user = User.create!(:login =&gt; 'admin', :password =&gt; 'abracadabra', :password_confirmation =&gt; 'abracadabra')
-  @admin_user.is_admin = true # is_admin is protected in user model
-  @admin_user.create_preference
-  @admin_user.preference.save
-  @admin_user.save
 end
 
-Given &quot;an admin user Reinier with the password abracadabra&quot; do
-  @reinier = User.create!(:login =&gt; 'reinier', :password =&gt; 'abracadabra', :password_confirmation =&gt; 'abracadabra', :is_admin =&gt; true)
-  @reinier.create_preference
-end
-
-Given &quot;an admin user Reinier&quot; do
-  Given &quot;an admin user Reinier with the password abracadabra&quot;
-end
-
-Given &quot;a logged in user Luis&quot; do
-  @luis = User.create!(:login =&gt; 'luis', :password =&gt; 'sesame', :password_confirmation =&gt; 'sesame', :is_admin =&gt; false)
-  @luis.create_preference
-  logged_in_as @luis
-end
-
-Given &quot;Reinier is not logged in&quot; do
-  #nothing to do
+Given &quot;no users exists&quot; do
+  User.delete_all
 end
 
-Given &quot;a visitor named Reinier&quot; do
-  #nothing to do
-end
+Then &quot;I should be an admin&quot; do
+  # just check on the presence of the menu item for managing users
+  Then &quot;I should see \&quot;Manage users\&quot;&quot;
+end
\ No newline at end of file</diff>
      <filename>features/step_definitions/user_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -98,6 +98,14 @@ Then /^I should not see &quot;([^\&quot;]*)&quot;$/ do |text|
   response.should_not contain(text)
 end
 
+Then /^the &quot;([^\&quot;]*)&quot; field should contain &quot;([^\&quot;]*)&quot;$/ do |field, value|
+      field_labeled(field).value.should =~ /#{value}/
+  end
+
+Then /^the &quot;([^\&quot;]*)&quot; field should not contain &quot;([^\&quot;]*)&quot;$/ do |field, value|
+      field_labeled(field).value.should_not =~ /#{value}/
+  end
+    
 Then /^the &quot;([^\&quot;]*)&quot; checkbox should be checked$/ do |label|
   field_labeled(label).should be_checked
 end</diff>
      <filename>features/step_definitions/webrat_steps.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,4 +14,4 @@ Webrat.configure do |config|
 end
 
 require 'cucumber/rails/rspec'
-require 'webrat/core/matchers'
+require 'webrat/core/matchers'
\ No newline at end of file</diff>
      <filename>features/support/env.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,7 +22,4 @@ module NavigationHelpers
   end
 end
 
-World do |world|
-  world.extend NavigationHelpers
-  world
-end
+World(NavigationHelpers)
\ No newline at end of file</diff>
      <filename>features/support/paths.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bdddac50206efbae554bbc4b9926b0b3bf032762</id>
    </parent>
  </parents>
  <author>
    <name>Reinier Balt</name>
    <email>lrbalt@gmail.com</email>
  </author>
  <url>http://github.com/bsag/tracks/commit/2073f84cd845a0829ca58281f9d6699bc9e4d77c</url>
  <id>2073f84cd845a0829ca58281f9d6699bc9e4d77c</id>
  <committed-date>2009-05-22T14:14:40-07:00</committed-date>
  <authored-date>2009-05-22T14:14:40-07:00</authored-date>
  <message>update cucumber and refactor some of the stories

inspired by the railscasts about cucumber. Also fix a problem with ZenTest on case sensitive platforms</message>
  <tree>c5dbb1b5975e5d7361d91b5c69cef18776ed6a6a</tree>
  <committer>
    <name>Reinier Balt</name>
    <email>lrbalt@gmail.com</email>
  </committer>
</commit>
