<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/factories/bands.rb</filename>
    </added>
    <added>
      <filename>test/factories/users.rb</filename>
    </added>
    <added>
      <filename>test/models/band.rb</filename>
    </added>
    <added>
      <filename>test/models/user.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,5 @@
-test/debug.log
-coverage
-rdoc
-test/database.yml
+test/debug.log
+coverage
+rdoc
+test/database.yml
+memory
\ No newline at end of file</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -1,47 +1,48 @@
-Testing
-==============
-
-Tests are written with the standard Rails setup of Test::Unit and run using rake. Test can either be run against a MySQL database or the faster in-memory SQLite3.
-
-
-MySQL
-=======
-
-1. Create a new Rails app.
-2. Install acts_as_follower as a plugin.
-3. Copy the database config within the plugin:
-    cp test/database.yml.example test/database.yml
-4. Create a database as specified in test/database.yml.
-5. Run the tests:
-    rake test
-    
-    
-SQLite3
-=======
-
-1. Create a new Rails app.
-2. Install acts_as_follower as a plugin.
-3. Copy the database config within the plugin:
-    cp test/database.yml.example test/database.yml
-4. Install the sqlite3 library (if you don't have it already):
-    sudo gem install sqlite3-ruby
-5. Run the tests:
-    DB=sqlite3 rake test
-
-
-Coverage
-=======
-
-Test coverage can be calculated using Rcov. Make sure you have the rcov gem installed.
-
-Again in the acts_as_follower directory:
-
-rake rcov:gen   # For sqlite
-
-or:
-
-DB=mysql rake rcov:gen   # For mysql
-
-The coverage will now be available in the test/coverage directory.
-
-rake rcov:clobber will delete the coverage directory.
+Testing
+==============
+
+Tests are written with Shoulda on top of Test::Unit and Factory Girl is used instead of fixtures.  Tests are run using rake. 
+Test can either be run against a MySQL database or the faster in-memory SQLite3.
+
+
+MySQL
+=======
+
+1. Create a new Rails app.
+2. Install acts_as_follower as a plugin.
+3. Copy the database config within the plugin:
+    cp test/database.yml.example test/database.yml
+4. Create a database as specified in test/database.yml.
+5. Run the tests:
+    rake test
+    
+    
+SQLite3
+=======
+
+1. Create a new Rails app.
+2. Install acts_as_follower as a plugin.
+3. Copy the database config within the plugin:
+    cp test/database.yml.example test/database.yml
+4. Install the sqlite3 library (if you don't have it already):
+    sudo gem install sqlite3-ruby
+5. Run the tests:
+    DB=sqlite3 rake test
+
+
+Coverage
+=======
+
+Test coverage can be calculated using Rcov. Make sure you have the rcov gem installed.
+
+Again in the acts_as_follower directory:
+
+rake rcov:gen   # For mysql
+
+or:
+
+rake rcov:gen DB=sqlite3   # For sqlite
+
+The coverage will now be available in the test/coverage directory.
+
+rake rcov:clobber will delete the coverage directory.</diff>
      <filename>test/TESTING</filename>
    </modified>
    <modified>
      <diff>@@ -1,33 +1,55 @@
-require File.dirname(__FILE__) + '/test_helper'
-
-class ActsAsFollowableTest &lt; Test::Unit::TestCase
-  fixtures :users, :follows
-  
-  def test_instance_methods_should_be_defined
-    assert users(:sam).respond_to?(:followers_count)
-    assert users(:sam).respond_to?(:followers)
-    assert users(:sam).respond_to?(:followed_by?)
-  end
-  
-  def test_followers_should_return_number_of_followers
-    assert_equal 0, users(:sam).followers_count
-    assert_equal 1, users(:jon).followers_count
-  end
-  
-  def test_followers_should_return_users
-    assert_equal [], users(:sam).followers
-    assert_equal [users(:sam)], users(:jon).followers
-  end
-  
-  def test_followed_by_should_return_follower_status
-    assert_equal true, users(:jon).followed_by?(users(:sam))
-    assert_equal false, users(:sam).followed_by?(users(:jon))
-  end
-  
-  def test_destroyed_followable_should_destroy_related_follows_records
-    assert_difference &quot;Follow.count &amp;&amp; users(:sam).all_following.size&quot;, -1 do
-      users(:jon).destroy
-    end
-  end
-  
-end
+require File.dirname(__FILE__) + '/test_helper'
+
+class ActsAsFollowableTest &lt; Test::Unit::TestCase
+  
+  context &quot;instance methods&quot; do
+    setup do
+      @sam = Factory(:sam)
+    end
+    
+    should &quot;be defined&quot; do
+      assert @sam.respond_to?(:followers_count)
+      assert @sam.respond_to?(:followers)
+      assert @sam.respond_to?(:followed_by?)
+    end
+  end
+  
+  context &quot;acts_as_followable&quot; do
+    setup do
+      @sam = Factory(:sam)
+      @jon = Factory(:jon)
+      @sam.follow(@jon)
+    end
+    
+    context &quot;followers_count&quot; do
+      should &quot;return the number of followers&quot; do
+        assert_equal 0, @sam.followers_count
+        assert_equal 1, @jon.followers_count
+      end
+    end
+    
+    context &quot;followers&quot; do
+      should &quot;return users&quot; do
+        assert_equal [], @sam.followers
+        assert_equal [@sam], @jon.followers
+      end
+    end
+    
+    context &quot;followed_by&quot; do
+      should &quot;return_follower_status&quot; do
+        assert_equal true, @jon.followed_by?(@sam)
+        assert_equal false, @sam.followed_by?(@jon)
+      end
+    end
+    
+    context &quot;destroying a followable&quot; do
+      setup do
+        @jon.destroy
+      end
+      
+      should_change &quot;Follow.count&quot;, :by =&gt; -1
+      should_change &quot;@sam.all_following.size&quot;, :by =&gt; -1
+    end
+  end
+  
+end</diff>
      <filename>test/acts_as_followable_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,84 +1,127 @@
-require File.dirname(__FILE__) + '/test_helper'
-
-class ActsAsFollowerTest &lt; Test::Unit::TestCase
-  fixtures :users, :follows, :bands
-  
-  def test_instance_methods_should_be_defined
-    assert users(:sam).respond_to?(:following?)
-    assert users(:sam).respond_to?(:follow_count)
-    assert users(:sam).respond_to?(:follow)
-    assert users(:sam).respond_to?(:stop_following)
-    assert users(:sam).respond_to?(:follows_by_type)
-    assert users(:sam).respond_to?(:all_follows)
-  end
-  
-  def test_following_should_returns_following_status
-    assert_equal true, users(:sam).following?(users(:jon))
-    assert_equal false, users(:jon).following?(users(:sam))
-  end
-  
-  def test_follow_count_should_return_count_of_followed_users
-    assert_equal 2, users(:sam).follow_count
-    assert_equal 0, users(:jon).follow_count
-  end
-  
-  def test_follow_should_create_relevant_follow_record
-    assert_difference &quot;Follow.count&quot;, 1 do
-      assert_difference &quot;users(:jon).follow_count&quot;, 1 do
-        users(:jon).follow(users(:sam))
-      end    
-    end
-    assert_equal users(:jon), Follow.last.follower
-    assert_equal users(:sam), Follow.last.followable
-  end
-  
-  def test_stop_following_should_create_relevant_follow_record
-    assert_difference &quot;Follow.count&quot;, -1 do
-      assert_difference &quot;users(:sam).follow_count&quot;, -1 do
-        users(:sam).stop_following(users(:jon))
-      end    
-    end
-  end
-  
-  def test_follows_by_type_should_return_only_requested_follows
-    assert_equal [follows(:band)], users(:sam).follows_by_type('Band')
-    assert_equal [follows(:user)], users(:sam).follows_by_type('User')
-  end
-  
-  def test_all_follows_should_return_all_follows
-    follows = users(:sam).all_follows
-    assert_equal 2, follows.size
-    assert follows.include?(follows(:band))
-    assert follows.include?(follows(:user))
-    assert_equal [], users(:jon).all_follows
-  end
-  
-  def test_all_following_should_return_actual_followed_records    
-    following = users(:sam).all_following
-    assert_equal 2, following.size
-    assert following.include?(bands(:oasis))
-    assert following.include?(users(:jon))
-    assert_equal [], users(:jon).all_following
-  end
-  
-  def test_following_by_type_should_return_only_requested_records
-    assert_equal [bands(:oasis)], users(:sam).following_by_type('Band')
-    assert_equal [users(:jon)], users(:sam).following_by_type('User')
-  end
-  
-  def test_method_missing_should_call_following_by_type
-    assert_equal [bands(:oasis)], users(:sam).following_bands
-    assert_equal [users(:jon)], users(:sam).following_users
-  end
-  
-  def test_method_missing_should_raise
-    assert_raises (NoMethodError){ users(:sam).foobar }
-  end
-  
-  def test_destroyed_follower_should_nullifys_related_follows_records
-    assert_difference &quot;Follow.count &amp;&amp; users(:sam).following_users.size&quot;, -1 do
-      users(:jon).destroy
-    end
-  end
-  
-end
+require File.dirname(__FILE__) + '/test_helper'
+
+class ActsAsFollowerTest &lt; Test::Unit::TestCase
+  
+  context &quot;instance methods&quot; do
+    setup do
+      @sam = Factory(:sam)
+    end
+    
+    should &quot;be defined&quot; do
+      assert @sam.respond_to?(:following?)
+      assert @sam.respond_to?(:follow_count)
+      assert @sam.respond_to?(:follow)
+      assert @sam.respond_to?(:stop_following)
+      assert @sam.respond_to?(:follows_by_type)
+      assert @sam.respond_to?(:all_follows)
+    end
+  end
+  
+  context &quot;acts_as_follower&quot; do
+    setup do
+      @sam = Factory(:sam)
+      @jon = Factory(:jon)
+      @oasis = Factory(:oasis)
+      @sam.follow(@jon)
+      @sam.follow(@oasis)
+    end
+    
+    context &quot;following&quot; do
+      should &quot;return following_status&quot; do
+        assert_equal true, @sam.following?(@jon)
+        assert_equal false, @jon.following?(@sam)
+      end
+      
+      should &quot;return follow_count&quot; do
+        assert_equal 2, @sam.follow_count
+        assert_equal 0, @jon.follow_count
+      end
+    end
+    
+    context &quot;follow&quot; do
+      setup do
+        @jon.follow(@sam)
+      end
+      
+      should_change &quot;Follow.count&quot;, :by =&gt; 1
+      should_change &quot;@jon.follow_count&quot;, :by =&gt; 1
+      
+      should &quot;set the follower&quot; do
+        assert_equal @jon, Follow.last.follower
+      end
+      
+      should &quot;set the followable&quot; do
+        assert_equal @sam, Follow.last.followable
+      end
+    end
+    
+    context &quot;stop_following&quot; do
+      setup do
+        @sam.stop_following(@jon)
+      end
+      
+      should_change &quot;Follow.count&quot;, :by =&gt; -1
+      should_change &quot;@sam.follow_count&quot;, :by =&gt; -1
+    end
+    
+    context &quot;follows&quot; do
+      setup do
+        @band_follow = Follow.find(:first, :conditions =&gt; [&quot;follower_id = ? and follower_type = 'User' and followable_id = ? and followable_type = 'Band'&quot;, @sam.id, @oasis.id])
+        @user_follow = Follow.find(:first, :conditions =&gt; [&quot;follower_id = ? and follower_type = 'User' and followable_id = ? and followable_type = 'User'&quot;, @sam.id, @jon.id])
+      end
+      
+      context &quot;follows_by_type&quot; do
+        should &quot;only return requested follows&quot; do
+          assert_equal [@band_follow], @sam.follows_by_type('Band')
+          assert_equal [@user_follow], @sam.follows_by_type('User')
+        end
+      end
+      
+      context &quot;all_follows&quot; do
+        should &quot;return all follows&quot; do
+          assert_equal 2, @sam.all_follows.size
+          assert @sam.all_follows.include?(@band_follow)
+          assert @sam.all_follows.include?(@user_follow)
+          assert_equal [], @jon.all_follows
+        end
+      end
+    end
+    
+    context &quot;all_following&quot; do
+      should &quot;return the actual follow records&quot; do
+        assert_equal 2, @sam.all_following.size
+        assert @sam.all_following.include?(@oasis)
+        assert @sam.all_following.include?(@jon)
+        assert_equal [], @jon.all_following
+      end
+    end
+    
+    context &quot;following_by_type&quot; do
+      should &quot;return only requested records&quot; do
+        assert_equal [@oasis], @sam.following_by_type('Band')
+        assert_equal [@jon], @sam.following_by_type('User')
+      end
+    end
+    
+    context &quot;method_missing&quot; do
+      should &quot;call following_by_type&quot; do
+        assert_equal [@oasis], @sam.following_bands
+        assert_equal [@jon], @sam.following_users
+      end
+      
+      should &quot;raise on no method&quot; do
+        assert_raises (NoMethodError){ @sam.foobar }
+      end
+    end
+    
+    context &quot;destroying follower&quot; do
+      setup do
+        @jon.destroy
+      end
+      
+      should_change &quot;Follow.count&quot;, :by =&gt; -1
+      should_change &quot;@sam.follow_count&quot;, :by =&gt; -1
+    end
+  end
+  
+end</diff>
      <filename>test/acts_as_follower_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,10 @@
-require File.dirname(__FILE__) + '/test_helper'
-
-class FollowTest &lt; Test::Unit::TestCase
-  
-  # Replace with real tests
-  def test_assert_true_should_be_true
-    assert true
-  end
-  
-end
+require File.dirname(__FILE__) + '/test_helper'
+
+class FollowTest &lt; Test::Unit::TestCase
+  
+  # Replace with real tests
+  def test_assert_true_should_be_true
+    assert true
+  end
+  
+end</diff>
      <filename>test/follow_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,33 +1,17 @@
-require 'test/unit'
-require 'rubygems'
-
-begin
-  require File.dirname(__FILE__) + '/../../../../config/boot'
-  require 'active_record'
-rescue LoadError
-  require 'rubygems'
-  require_gem 'activerecord'
-end
-
-require 'active_record/fixtures'
-
-require File.dirname(__FILE__) + '/../init.rb'
-
-ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + '/debug.log')
-ActiveRecord::Base.configurations = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
-ActiveRecord::Base.establish_connection(ENV['DB'] || 'mysql')
-
-load(File.dirname(__FILE__) + '/schema.rb')
-
-Test::Unit::TestCase.fixture_path = File.dirname(__FILE__) + '/fixtures/'
-$LOAD_PATH.unshift(Test::Unit::TestCase.fixture_path)
-
-class Test::Unit::TestCase #:nodoc:
-  self.use_transactional_fixtures = true
-  self.use_instantiated_fixtures  = false
-  
-  def setup
-    # Put any additional setup here.
-  end
-  
-end
+require 'rubygems'
+require 'active_record'
+require 'active_record/base'
+
+require File.dirname(__FILE__) + '/../init.rb'
+require File.dirname(__FILE__) + '/models/band'
+require File.dirname(__FILE__) + '/models/user'
+
+require 'test/unit'
+require 'shoulda'
+require 'factory_girl'
+
+ActiveRecord::Base.logger = Logger.new(File.dirname(__FILE__) + '/debug.log')
+ActiveRecord::Base.configurations = YAML::load(IO.read(File.dirname(__FILE__) + '/database.yml'))
+ActiveRecord::Base.establish_connection(ENV['DB'] || 'mysql')
+
+load(File.dirname(__FILE__) + '/schema.rb')</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>test/fixtures/band.rb</filename>
    </removed>
    <removed>
      <filename>test/fixtures/bands.yml</filename>
    </removed>
    <removed>
      <filename>test/fixtures/follows.yml</filename>
    </removed>
    <removed>
      <filename>test/fixtures/user.rb</filename>
    </removed>
    <removed>
      <filename>test/fixtures/users.yml</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>fddbe1966ab99dc864168c00447efef1698fa51f</id>
    </parent>
  </parents>
  <author>
    <name>Tom Cocca</name>
    <email>tom.cocca@gmail.com</email>
  </author>
  <url>http://github.com/tcocca/acts_as_follower/commit/fe0b633574b7fd8de4249755ab435cb41bdfc737</url>
  <id>fe0b633574b7fd8de4249755ab435cb41bdfc737</id>
  <committed-date>2009-04-30T17:47:03-07:00</committed-date>
  <authored-date>2009-04-30T17:47:03-07:00</authored-date>
  <message>Converted the tests to use Shoulda and Factory Girl, removed old fixtures</message>
  <tree>f74d447120bff31e91bca1bc6359a1c2848478f1</tree>
  <committer>
    <name>Tom Cocca</name>
    <email>tom.cocca@gmail.com</email>
  </committer>
</commit>
