<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,20 +1,46 @@
 require File.join(File.dirname(__FILE__), &quot;..&quot;, &quot;test_helper&quot;)
 
 class WorklingDelta::WorkerTest &lt; Test::Unit::TestCase
-    context &quot;a worker&quot; do
-      should &quot;trigger a TS delta job with the index name&quot; do
-        mock_job = mock(ThinkingSphinx::Deltas::DeltaJob).new(index_name)
-        mock_job.perform
+  context &quot;a worker&quot; do
+    setup do
+      @index_name = &quot;the_delta_index&quot;
+      @document_id = 1
 
-        WorklingDeltaIndexer.async_index
-      end
+      @job = mock(Object)
+      mock(ThinkingSphinx::Deltas::DeltaJob).new(@index_name) { @job }
+      @job.perform
+    end
 
-      should &quot;trigger a flag as deleted job if I pass a document id&quot; do
+    context &quot;that doesn't receive a document id&quot; do
+      
+      should &quot;perform a TS delta job with the index name&quot; do
+        invoke_worker(:index_name =&gt; @index_name)
+      end
 
+      should &quot;not perform a flag as deleted job if I don't pass a document id&quot; do
+        dont_allow(ThinkingSphinx::Deltas::FlagAsDeletedJob).new(
+         anything, anything)
+        
+        invoke_worker(:index_name =&gt; @index_name)
       end
 
-      should &quot;not trigger a flag as deleted job if I don't pass a document id&quot; do
+    end
+
+    context &quot;that receives a document id&quot; do
+      should &quot;trigger a flag as deleted job if I pass a document id&quot; do
+        delete_job = mock(Object)
+        mock(ThinkingSphinx::Deltas::FlagAsDeletedJob).new(
+          @index_name, @document_id) { delete_job }
+        delete_job.perform
 
+        invoke_worker(:index_name =&gt; @index_name, :document_id =&gt; @document_id)
       end
     end
+    
+  end
+
+  private
+  def invoke_worker(options = {})
+    WorklingDelta::Worker.new.index(options)
+  end
 end</diff>
      <filename>test/workling_delta/worker_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b6dec5ddbb6b45e1858b6332ef6a64a2f26b3cd1</id>
    </parent>
  </parents>
  <author>
    <name>Dan Pickett</name>
    <email>dpickett@enlightsolutions.com</email>
  </author>
  <url>http://github.com/dpickett/workling_delta_indexer/commit/66172051a22fea5a0b3227fa49324eb9e298bcbd</url>
  <id>66172051a22fea5a0b3227fa49324eb9e298bcbd</id>
  <committed-date>2009-03-07T15:52:22-08:00</committed-date>
  <authored-date>2009-03-07T15:52:22-08:00</authored-date>
  <message>completed test harness</message>
  <tree>0d713d78467078518c5bc0787c1cbe930f17243f</tree>
  <committer>
    <name>Dan Pickett</name>
    <email>dpickett@enlightsolutions.com</email>
  </committer>
</commit>
