<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/controller_macros.rb</filename>
    </added>
    <added>
      <filename>spec/controllers/hazmat_classes_controller_spec.rb</filename>
    </added>
    <added>
      <filename>spec/models/student_spec.rb</filename>
    </added>
    <added>
      <filename>spec/support/authlogic/macros.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,4 +4,6 @@ db/schema.rb
 log/*.log
 config/database.yml
 config/env_hook.rb
+spec/*.txt
+spec/*.html
 tmp
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,6 @@
 class HazmatClass &lt; ActiveRecord::Base
+  default_scope :order =&gt; 'start_date DESC, end_date DESC'
+  
   has_many :enrollments
   has_many :students, :through =&gt; :enrollments
   accepts_nested_attributes_for :students, :reject_if =&gt; lambda { |a| a.values.all?(&amp;:blank?) }, :allow_destroy =&gt; true
@@ -8,8 +10,8 @@ class HazmatClass &lt; ActiveRecord::Base
   validates_date :end_date
   
   def dates
-    start_format_string = '%b %d' &lt;&lt; (end_date.year != start_date.year ? ', %Y' : '')
-    end_format_string = (start_date.month != end_date.month ? '%b ' : '') &lt;&lt; (start_date.day != end_date.day ? '%d' : '') &lt;&lt; ', %Y'
+    start_format_string = '%b ' &lt;&lt; start_date.day.to_i.to_s &lt;&lt; (end_date.year != start_date.year ? ', %Y' : '')
+    end_format_string = (start_date.month != end_date.month ? '%b ' : '') &lt;&lt; (start_date.day != end_date.day ? end_date.day.to_i.to_s : '') &lt;&lt; ', %Y'
     &quot;#{ start_date.strftime(start_format_string) }#{ start_date != end_date ? '-' : '' }#{ end_date.strftime(end_format_string) }&quot;
   end
 end</diff>
      <filename>app/models/hazmat_class.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,4 @@
 ActionController::Routing::Routes.draw do |map|
-
   map.logout 'logout', :controller =&gt; 'user_sessions', :action =&gt; 'destroy'
   map.login 'login', :controller =&gt; 'user_sessions', :action =&gt; 'new'
   map.resources :user_sessions</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,4 +17,11 @@ end
 # Factory.define :enrollment do |f|
 #   f.student { |c| c.association(:student) }
 #   f.hazmat_class { |c| c.association(:hazmat_class) }
-# end
\ No newline at end of file
+# end
+
+Factory.define :user do |f|
+  f.sequence(:username) { |n| &quot;Ulga the User #{n}&quot; }
+  f.password &quot;secret&quot;
+  f.password_confirmation &quot;secret&quot;
+  f.email &quot;ulga@example.com&quot;
+end
\ No newline at end of file</diff>
      <filename>spec/factories.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,11 +14,11 @@ describe HazmatClass do
   end
   
   it &quot;should not be valid when start date is after end date&quot; do
-    Factory.build(:start_date =&gt; '2009-10-22', :end_date =&gt; '2009-10-21').should_not be_valid
+    Factory.build(:hazmat_class, :start_date =&gt; '2009-10-22', :end_date =&gt; '2009-10-21').should_not be_valid
   end
   
   it &quot;should display just one date for 1-day classes&quot; do
-    company = Factory.create(:start_date =&gt; '2009-10-22', :end_date =&gt; '2009-10-22')
+    company = Factory.create(:hazmat_class, :start_date =&gt; '2009-10-22', :end_date =&gt; '2009-10-22')
     company.dates.should == 'Oct 22, 2009'
   end
 
@@ -29,12 +29,12 @@ describe HazmatClass do
   
   it &quot;should display a range of dates for 2-day classes spanning months&quot; do
     company = Factory.create(:hazmat_class, :start_date =&gt; '2009-10-31', :end_date =&gt; '2009-11-01')
-    company.dates.should == 'Oct 31-Nov 01, 2009'
+    company.dates.should == 'Oct 31-Nov 1, 2009'
   end
   
   it &quot;should display a range of dates for 2-day classes spanning years&quot; do
     company = Factory.create(:hazmat_class, :start_date =&gt; '2009-12-31', :end_date =&gt; '2010-01-01')
-    company.dates.should == 'Dec 31, 2009-Jan 01, 2010'
+    company.dates.should == 'Dec 31, 2009-Jan 1, 2010'
   end
   
   it &quot;should accept nested attributes for students&quot; do</diff>
      <filename>spec/models/hazmat_class_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,7 @@
 --colour
---format progress
+--format nested
+--format specdoc:spec/spec_full_report.txt
+--format failing_examples:spec/spec_failing_examples.txt
+--format html:spec/spec_report.html
 --loadby mtime
---reverse
+--reverse
\ No newline at end of file</diff>
      <filename>spec/spec.opts</filename>
    </modified>
    <modified>
      <diff>@@ -4,6 +4,7 @@ gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f &gt;= 1.9
 require 'spec/autorun'
 require 'spec/rails'
 require File.expand_path(File.join(File.dirname(__FILE__),'factories'))
+require File.expand_path(File.join(File.dirname(__FILE__),'controller_macros'))
 
 Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
 
@@ -11,4 +12,6 @@ Spec::Runner.configure do |config|
   config.use_transactional_fixtures = true
   config.use_instantiated_fixtures  = false
   config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+  
+  config.include(ControllerMacros, :type =&gt; :controller)
 end</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>de515bc7a5b666039f5b88369e77ce5651ec21cb</id>
    </parent>
  </parents>
  <author>
    <name>Tim Gossett</name>
    <email>tim@mrgossett.com</email>
  </author>
  <url>http://github.com/MrGossett/class-roster/commit/84667a2b77ee9bf926c727d96e6d52d5399d931d</url>
  <id>84667a2b77ee9bf926c727d96e6d52d5399d931d</id>
  <committed-date>2009-10-26T11:12:37-07:00</committed-date>
  <authored-date>2009-10-26T11:12:37-07:00</authored-date>
  <message>refactored HazmatClass#dates; all specs pass</message>
  <tree>bea0757f67197c2daa74503a2b53730292aebf9f</tree>
  <committer>
    <name>Tim Gossett</name>
    <email>tim@mrgossett.com</email>
  </committer>
</commit>
