<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>spec/spec_helper.rb.bak</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
-RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
 
 require File.join(File.dirname(__FILE__), 'boot')
 require 'yaml' 
@@ -20,7 +20,7 @@ Rails::Initializer.run do |config|
   config.gem 'thoughtbot-factory_girl', :lib =&gt; 'factory_girl', :source =&gt; 'http://gems.github.com'
   config.gem &quot;rubyist-aasm&quot;, :lib =&gt; &quot;aasm&quot;, :version =&gt; '&gt;=2.0.5', :source =&gt; 'http://gems.github.com'
   config.gem 'mislav-will_paginate', :lib =&gt; 'will_paginate', :version =&gt; '&gt;=2.3.7', :source =&gt; 'http://gems.github.com/'
-  config.gem &quot;rspec-rails&quot;, :lib =&gt; false, :version =&gt; &quot;= 1.1.11&quot;
+  config.gem &quot;rspec-rails&quot;, :lib =&gt; false, :version =&gt; &quot;= 1.2.2&quot;
   config.gem &quot;cucumber&quot;, :lib =&gt; false, :version =&gt; &quot;= 0.1.12&quot;
   config.gem &quot;webrat&quot;, :lib =&gt; false, :version =&gt; &quot;= 0.3.2&quot;
 </diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,36 @@
-raise &quot;To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec&quot; if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec pkg]))
-raise &quot;To avoid rake task loading problems: run 'rake clobber' in vendor/plugins/rspec-rails&quot; if File.directory?(File.join(File.dirname(__FILE__), *%w[.. .. vendor plugins rspec-rails pkg]))
+gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f &gt;= 1.9
 
-# In rails 1.2, plugins aren't available in the path until they're loaded.
-# Check to see if the rspec plugin is installed first and require
-# it if it is.  If not, use the gem version.
-rspec_base = File.expand_path(File.dirname(__FILE__) + '/../../vendor/plugins/rspec/lib')
-$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
-require 'spec/rake/spectask'
+# Don't load rspec if running &quot;rake gems:*&quot;
+unless ARGV.any? {|a| a =~ /^gems/}
+
+begin
+  require 'spec/rake/spectask'
+rescue MissingSourceFile
+  module Spec
+    module Rake
+      class SpecTask
+        def initialize(name)
+          task name do
+            # if rspec-rails is a configured gem, this will output helpful material and exit ...
+            require File.expand_path(File.dirname(__FILE__) + &quot;/../../config/environment&quot;)
+
+            # ... otherwise, do this:
+            raise &lt;&lt;-MSG
+
+#{&quot;*&quot; * 80}
+*  You are trying to run an rspec rake task defined in
+*  #{__FILE__},
+*  but rspec can not be found in vendor/gems, vendor/plugins or system gems.
+#{&quot;*&quot; * 80}
+MSG
+          end
+        end
+      end
+    end
+  end
+end
+
+Rake.application.instance_variable_get('@tasks').delete('default')
 
 spec_prereq = File.exist?(File.join(RAILS_ROOT, 'config', 'database.yml')) ? &quot;db:test:prepare&quot; : :noop
 task :noop do
@@ -18,51 +42,51 @@ task :stats =&gt; &quot;spec:statsetup&quot;
 desc &quot;Run all specs in spec directory (excluding plugin specs)&quot;
 Spec::Rake::SpecTask.new(:spec =&gt; spec_prereq) do |t|
   t.spec_opts = ['--options', &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]
-  t.spec_files = FileList['spec/**/*_spec.rb']
+  t.spec_files = FileList['spec/**/*/*_spec.rb']
 end
 
 namespace :spec do
   desc &quot;Run all specs in spec directory with RCov (excluding plugin specs)&quot;
   Spec::Rake::SpecTask.new(:rcov) do |t|
     t.spec_opts = ['--options', &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]
-    t.spec_files = FileList['spec/**/*_spec.rb']
+    t.spec_files = FileList['spec/**/*/*_spec.rb']
     t.rcov = true
     t.rcov_opts = lambda do
       IO.readlines(&quot;#{RAILS_ROOT}/spec/rcov.opts&quot;).map {|l| l.chomp.split &quot; &quot;}.flatten
     end
   end
-  
+
   desc &quot;Print Specdoc for all specs (excluding plugin specs)&quot;
   Spec::Rake::SpecTask.new(:doc) do |t|
     t.spec_opts = [&quot;--format&quot;, &quot;specdoc&quot;, &quot;--dry-run&quot;]
-    t.spec_files = FileList['spec/**/*_spec.rb']
+    t.spec_files = FileList['spec/**/*/*_spec.rb']
   end
 
-  desc &quot;Print Specdoc for all plugin specs&quot;
+  desc &quot;Print Specdoc for all plugin examples&quot;
   Spec::Rake::SpecTask.new(:plugin_doc) do |t|
     t.spec_opts = [&quot;--format&quot;, &quot;specdoc&quot;, &quot;--dry-run&quot;]
-    t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*')
+    t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*')
   end
 
   [:models, :controllers, :views, :helpers, :lib].each do |sub|
-    desc &quot;Run the specs under spec/#{sub}&quot;
+    desc &quot;Run the code examples in spec/#{sub}&quot;
     Spec::Rake::SpecTask.new(sub =&gt; spec_prereq) do |t|
       t.spec_opts = ['--options', &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]
       t.spec_files = FileList[&quot;spec/#{sub}/**/*_spec.rb&quot;]
     end
   end
-  
-  desc &quot;Run the specs under vendor/plugins (except RSpec's own)&quot;
+
+  desc &quot;Run the code examples in vendor/plugins (except RSpec's own)&quot;
   Spec::Rake::SpecTask.new(:plugins =&gt; spec_prereq) do |t|
     t.spec_opts = ['--options', &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]
-    t.spec_files = FileList['vendor/plugins/**/spec/**/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude(&quot;vendor/plugins/rspec-rails/*&quot;)
+    t.spec_files = FileList['vendor/plugins/**/spec/**/*/*_spec.rb'].exclude('vendor/plugins/rspec/*').exclude(&quot;vendor/plugins/rspec-rails/*&quot;)
   end
-  
+
   namespace :plugins do
     desc &quot;Runs the examples for rspec_on_rails&quot;
     Spec::Rake::SpecTask.new(:rspec_on_rails) do |t|
       t.spec_opts = ['--options', &quot;\&quot;#{RAILS_ROOT}/spec/spec.opts\&quot;&quot;]
-      t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*_spec.rb']
+      t.spec_files = FileList['vendor/plugins/rspec-rails/spec/**/*/*_spec.rb']
     end
   end
 
@@ -74,36 +98,41 @@ namespace :spec do
     ::STATS_DIRECTORIES &lt;&lt; %w(Controller\ specs spec/controllers) if File.exist?('spec/controllers')
     ::STATS_DIRECTORIES &lt;&lt; %w(Helper\ specs spec/helpers) if File.exist?('spec/helpers')
     ::STATS_DIRECTORIES &lt;&lt; %w(Library\ specs spec/lib) if File.exist?('spec/lib')
+    ::STATS_DIRECTORIES &lt;&lt; %w(Routing\ specs spec/lib) if File.exist?('spec/routing')
     ::CodeStatistics::TEST_TYPES &lt;&lt; &quot;Model specs&quot; if File.exist?('spec/models')
     ::CodeStatistics::TEST_TYPES &lt;&lt; &quot;View specs&quot; if File.exist?('spec/views')
     ::CodeStatistics::TEST_TYPES &lt;&lt; &quot;Controller specs&quot; if File.exist?('spec/controllers')
     ::CodeStatistics::TEST_TYPES &lt;&lt; &quot;Helper specs&quot; if File.exist?('spec/helpers')
     ::CodeStatistics::TEST_TYPES &lt;&lt; &quot;Library specs&quot; if File.exist?('spec/lib')
-    ::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
+    ::CodeStatistics::TEST_TYPES &lt;&lt; &quot;Routing specs&quot; if File.exist?('spec/routing')
   end
 
   namespace :db do
     namespace :fixtures do
-      desc &quot;Load fixtures (from spec/fixtures) into the current environment's database.  Load specific fixtures using FIXTURES=x,y&quot;
+      desc &quot;Load fixtures (from spec/fixtures) into the current environment's database.  Load specific fixtures using FIXTURES=x,y. Load from subdirectory in test/fixtures using FIXTURES_DIR=z.&quot;
       task :load =&gt; :environment do
+        ActiveRecord::Base.establish_connection(Rails.env)
+        base_dir = File.join(Rails.root, 'spec', 'fixtures')
+        fixtures_dir = ENV['FIXTURES_DIR'] ? File.join(base_dir, ENV['FIXTURES_DIR']) : base_dir
+        
         require 'active_record/fixtures'
-        ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
-        (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
-          Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
+        (ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/).map {|f| File.join(fixtures_dir, f) } : Dir.glob(File.join(fixtures_dir, '*.{yml,csv}'))).each do |fixture_file|
+          Fixtures.create_fixtures(File.dirname(fixture_file), File.basename(fixture_file, '.*'))
         end
       end
     end
   end
 
   namespace :server do
-    daemonized_server_pid = File.expand_path(&quot;spec_server.pid&quot;, RAILS_ROOT + &quot;/tmp&quot;)
-
+    daemonized_server_pid = File.expand_path(&quot;#{RAILS_ROOT}/tmp/pids/spec_server.pid&quot;)
+    
     desc &quot;start spec_server.&quot;
     task :start do
       if File.exist?(daemonized_server_pid)
         $stderr.puts &quot;spec_server is already running.&quot;
       else
-        $stderr.puts &quot;Starting up spec server.&quot;
+        $stderr.puts %Q{Starting up spec_server ...}
+        FileUtils.mkdir_p('tmp/pids') unless test ?d, 'tmp/pids'
         system(&quot;ruby&quot;, &quot;script/spec_server&quot;, &quot;--daemon&quot;, &quot;--pid&quot;, daemonized_server_pid)
       end
     end
@@ -113,20 +142,24 @@ namespace :spec do
       unless File.exist?(daemonized_server_pid)
         $stderr.puts &quot;No server running.&quot;
       else
-        $stderr.puts &quot;Shutting down spec_server.&quot;
+        $stderr.puts &quot;Shutting down spec_server ...&quot;
         system(&quot;kill&quot;, &quot;-s&quot;, &quot;TERM&quot;, File.read(daemonized_server_pid).strip) &amp;&amp; 
         File.delete(daemonized_server_pid)
       end
     end
 
-    desc &quot;reload spec_server.&quot;
-    task :restart do
-      unless File.exist?(daemonized_server_pid)
-        $stderr.puts &quot;No server running.&quot;
+    desc &quot;restart spec_server.&quot;
+    task :restart =&gt; [:stop, :start]
+    
+    desc &quot;check if spec server is running&quot;
+    task :status do
+      if File.exist?(daemonized_server_pid)
+        $stderr.puts %Q{spec_server is running (PID: #{File.read(daemonized_server_pid).gsub(&quot;\n&quot;,&quot;&quot;)})}
       else
-        $stderr.puts &quot;Reloading down spec_server.&quot;
-        system(&quot;kill&quot;, &quot;-s&quot;, &quot;USR2&quot;, File.read(daemonized_server_pid).strip)
+        $stderr.puts &quot;No server running.&quot;
       end
     end
   end
 end
+
+end
\ No newline at end of file</diff>
      <filename>lib/tasks/rspec.rake</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,5 @@
 #!/usr/bin/env ruby
+gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f &gt;= 1.9
 ENV['RSPEC'] = 'true'     # allows autotest to discover rspec
 ENV['AUTOTEST'] = 'true'  # allows autotest to run w/ color on linux
 system((RUBY_PLATFORM =~ /mswin|mingw/ ? 'autotest.bat' : 'autotest'), *ARGV) ||</diff>
      <filename>script/autospec</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,10 @@
 #!/usr/bin/env ruby
-$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__) + &quot;/../vendor/plugins/rspec/lib&quot;))
-require 'rubygems'
-require 'spec'
-exit ::Spec::Runner::CommandLine.run(::Spec::Runner::OptionParser.parse(ARGV, STDERR, STDOUT))
+if ARGV.any? {|arg| %w[--drb -X --generate-options -G --help -h --version -v].include?(arg)}
+  require 'rubygems' unless ENV['NO_RUBYGEMS']
+else
+  gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f &gt;= 1.9
+  ENV[&quot;RAILS_ENV&quot;] ||= 'test'
+  require File.dirname(__FILE__) + &quot;/../config/environment&quot; unless defined?(RAILS_ROOT)
+end
+require 'spec/autorun'
+exit ::Spec::Runner::CommandLine.run</diff>
      <filename>script/spec</filename>
    </modified>
    <modified>
      <diff>@@ -1,116 +1,9 @@
 #!/usr/bin/env ruby
-$LOAD_PATH.unshift File.dirname(__FILE__) + '/../vendor/plugins/rspec/lib' # For rspec installed as plugin
-require 'rubygems'
-require 'drb/drb'
-require 'rbconfig'
-require 'spec'
-require 'optparse'
-
-# This is based on Florian Weber's TDDMate
-module Spec
-  module Runner
-    class RailsSpecServer
-      def run(argv, stderr, stdout)
-        $stdout = stdout
-        $stderr = stderr
-
-        base = ActiveRecord::Base
-        def base.clear_reloadable_connections!
-          active_connections.each do |name, conn|
-            if conn.requires_reloading?
-              conn.disconnect!
-              active_connections.delete(name)
-            end
-          end
-        end
-
-        if ActionController.const_defined?(:Dispatcher)
-          dispatcher = ::ActionController::Dispatcher.new($stdout)
-          dispatcher.cleanup_application
-        elsif ::Dispatcher.respond_to?(:reset_application!)
-          ::Dispatcher.reset_application!
-        else
-          raise &quot;Application reloading failed&quot;
-        end
-        if Object.const_defined?(:Fixtures) &amp;&amp; Fixtures.respond_to?(:reset_cache)
-          Fixtures.reset_cache
-        end
-
-        ::Dependencies.mechanism = :load
-        require_dependency('application.rb') unless Object.const_defined?(:ApplicationController)
-        load File.dirname(__FILE__) + '/../spec/spec_helper.rb'
-
-        if in_memory_database?
-          load &quot;#{RAILS_ROOT}/db/schema.rb&quot; # use db agnostic schema by default
-          ActiveRecord::Migrator.up('db/migrate') # use migrations
-        end
-
-        ::Spec::Runner::CommandLine.run(
-          ::Spec::Runner::OptionParser.parse(
-            argv,
-            $stderr,
-            $stdout
-          )
-        )
-      end
+gem 'test-unit', '1.2.3' if RUBY_VERSION.to_f &gt;= 1.9
 
-      def in_memory_database?
-        ENV[&quot;RAILS_ENV&quot;] == &quot;test&quot; and
-        ::ActiveRecord::Base.connection.class.to_s == &quot;ActiveRecord::ConnectionAdapters::SQLite3Adapter&quot; and
-        ::Rails::Configuration.new.database_configuration['test']['database'] == ':memory:'
-      end
-    end
-  end
-end
 puts &quot;Loading Rails environment&quot;
+ENV[&quot;RAILS_ENV&quot;] ||= 'test'
+require File.dirname(__FILE__) + &quot;/../config/environment&quot; unless defined?(RAILS_ROOT)
 
-ENV[&quot;RAILS_ENV&quot;] = &quot;test&quot;
-require File.expand_path(File.dirname(__FILE__) + &quot;/../config/environment&quot;)
-require 'dispatcher'
-
-def restart_test_server
-  puts &quot;restarting&quot;
-  config       = ::Config::CONFIG
-  ruby         = File::join(config['bindir'], config['ruby_install_name']) + config['EXEEXT']
-  command_line = [ruby, $0, ARGV].flatten.join(' ')
-  exec(command_line)
-end
-
-def daemonize(pid_file = nil)
-  return yield if $DEBUG
-  pid = Process.fork{
-    Process.setsid
-    Dir.chdir(RAILS_ROOT)
-    trap(&quot;SIGINT&quot;){ exit! 0 }
-    trap(&quot;SIGTERM&quot;){ exit! 0 }
-    trap(&quot;SIGHUP&quot;){ restart_test_server }
-    File.open(&quot;/dev/null&quot;){|f|
-      STDERR.reopen f
-      STDIN.reopen  f
-      STDOUT.reopen f
-    }
-    yield
-  }
-  puts &quot;spec_server launched. (PID: %d)&quot; % pid
-  File.open(pid_file,&quot;w&quot;){|f| f.puts pid } if pid_file
-  exit! 0
-end
-
-options = Hash.new
-opts = OptionParser.new
-opts.on(&quot;-d&quot;, &quot;--daemon&quot;){|v| options[:daemon] = true }
-opts.on(&quot;-p&quot;, &quot;--pid PIDFILE&quot;){|v| options[:pid] = v }
-opts.parse!(ARGV)
-
-puts &quot;Ready&quot;
-exec_server = lambda {
-  trap(&quot;USR2&quot;) { restart_test_server } if Signal.list.has_key?(&quot;USR2&quot;)
-  DRb.start_service(&quot;druby://127.0.0.1:8989&quot;, Spec::Runner::RailsSpecServer.new)
-  DRb.thread.join
-}
-
-if options[:daemon]
-  daemonize(options[:pid], &amp;exec_server)
-else
-  exec_server.call
-end
+require 'optparse'
+require 'spec/rails/spec_server'</diff>
      <filename>script/spec_server</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,8 @@
 # This file is copied to ~/spec when you run 'ruby script/generate rspec'
 # from the project root directory.
-ENV[&quot;RAILS_ENV&quot;] = &quot;test&quot;
-require File.expand_path(File.dirname(__FILE__) + &quot;/../config/environment&quot;)
-require 'spec'
+ENV[&quot;RAILS_ENV&quot;] ||= 'test'
+require File.dirname(__FILE__) + &quot;/../config/environment&quot; unless defined?(RAILS_ROOT)
+require 'spec/autorun'
 require 'spec/rails'
 require 'factory_girl'
 
@@ -13,15 +13,33 @@ Spec::Runner.configure do |config|
   config.use_transactional_fixtures = true
   config.use_instantiated_fixtures  = false
   config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
-  config.with_options(:behaviour_type =&gt; :helpers) do |config|  
-    config.include Haml::Helpers  
-    config.include ActionView::Helpers  
-    config.prepend_before :all do  
+  config.with_options(:behaviour_type =&gt; :helpers) do |config|
+    config.include Haml::Helpers
+    config.include ActionView::Helpers
+    config.prepend_before :all do
        init_haml_helpers
-    end  
+    end
   end
-  
 
+  # == Fixtures
+  #
+  # You can declare fixtures for each example_group like this:
+  #   describe &quot;....&quot; do
+  #     fixtures :table_a, :table_b
+  #
+  # Alternatively, if you prefer to declare them only once, you can
+  # do so right here. Just uncomment the next line and replace the fixture
+  # names with your fixtures.
+  #
+  # config.global_fixtures = :table_a, :table_b
+  #
+  # If you declare global fixtures, be aware that they will be declared
+  # for all of your examples, even those that don't use them.
+  #
+  # You can also declare which fixtures to use (for example fixtures for test/fixtures):
+  #
+  # config.fixture_path = RAILS_ROOT + '/spec/fixtures/'
+  #
   # == Mock Framework
   #
   # RSpec uses it's own mocking framework by default. If you prefer to
@@ -30,6 +48,10 @@ Spec::Runner.configure do |config|
   # config.mock_with :mocha
   # config.mock_with :flexmock
   # config.mock_with :rr
+  #
+  # == Notes
+  #
+  # For more information take a look at Spec::Runner::Configuration and Spec::Runner
   config.include AuthenticatedTestHelper
 end
 
@@ -45,7 +67,7 @@ end
 
 def route_matches(path, method, params)
   it &quot;maps #{params.inspect} to #{path.inspect}&quot; do
-    route_for(params).should == path
+    route_for(params).should == {:path =&gt; path, :method =&gt; method}
   end
 
   it &quot;generates params #{params.inspect} from #{method.to_s.upcase} to #{path.inspect}&quot; do
@@ -83,7 +105,7 @@ def requires_presence_of(clazz, field)
 end
 
 def requires_presence_of_field_on_purchase(clazz, field)
-  it &quot;requires #{field}&quot; do      
+  it &quot;requires #{field}&quot; do
     record = Factory.build(clazz.to_s.underscore.to_sym, field.to_sym =&gt; nil)
     record.stub!(:credit_covers_total?).and_return(false)
     record.should_not be_valid
@@ -93,7 +115,7 @@ end
 
 def has_dollar_field(clazz, field_name)
   field_name = field_name.to_sym
-  class_sym = clazz.to_s.underscore.to_sym 
+  class_sym = clazz.to_s.underscore.to_sym
   cents_field = :&quot;#{field_name}_in_cents&quot;
 
   it &quot;returns #{field_name} on ##{field_name}&quot; do</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b526343aa443cab48162df8c332b4c1e84a77c2c</id>
    </parent>
  </parents>
  <author>
    <name>Jacqui Maher and Veez (Matt Remsik)</name>
    <email>dev+jacqui+veez@hashrocket.com</email>
  </author>
  <url>http://github.com/spot-us/spot-us/commit/dd31590e205e023b853a79f9fe184cff3d69f845</url>
  <id>dd31590e205e023b853a79f9fe184cff3d69f845</id>
  <committed-date>2009-04-13T14:47:07-07:00</committed-date>
  <authored-date>2009-04-13T14:47:07-07:00</authored-date>
  <message>Updated rspec to 1.2.2</message>
  <tree>0c3ba965febcbeec67046fcc1c63e9135e1a8073</tree>
  <committer>
    <name>Veez (Matt Remsik)</name>
    <email>mremsik@gmail.com</email>
  </committer>
</commit>
