Index: trunk/test/integration/TaskSearchServiceTests.groovy
===================================================================
--- trunk/test/integration/TaskSearchServiceTests.groovy	(revision 511)
+++ trunk/test/integration/TaskSearchServiceTests.groovy	(revision 512)
@@ -70,35 +70,41 @@
 
         // Tasks in the trash should not be returned.
-        tasks[0].trash = true
-        tasks[0].save(flush:true)
+        taskA.trash = true
+        taskA.save(flush:true)
         assert taskSearchService.getTasks([:]).totalCount == taskCount - 1
-        tasks[1].trash = true
-        tasks[1].save(flush:true)
+        taskB.trash = true
+        taskB.save(flush:true)
         assert taskSearchService.getTasks([:]).totalCount == taskCount - 2
 
         // Restored tasks should be returned.
-        tasks[0].trash = false
-        tasks[0].save(flush:true)
+        taskA.trash = false
+        taskA.save(flush:true)
         assert taskSearchService.getTasks([:]).totalCount == taskCount - 1
-        tasks[1].trash = false
-        tasks[1].save(flush:true)
+        taskB.trash = false
+        taskB.save(flush:true)
         assert taskSearchService.getTasks([:]).totalCount == taskCount
 
         // Tomorrows tasks should not be returned.
-        tasks[0].targetStartDate = dateUtilService.tomorrow
-        tasks[0].targetCompletionDate = dateUtilService.tomorrow
-        tasks[0].save(flush:true)
+        taskA.targetStartDate = dateUtilService.tomorrow
+        taskA.targetCompletionDate = dateUtilService.tomorrow
+        taskA.save(flush:true)
         assert taskSearchService.getTasks([:]).totalCount == taskCount - 1
 
+        // Tomorrows tasks should be returned, if we ask for them.
+        assert taskSearchService.getTasks([:], dateUtilService.today, dateUtilService.tomorrow+1).totalCount == taskCount
+
         // Yesterdays tasks should not be returned.
-        tasks[0].targetStartDate = dateUtilService.yesterday
-        tasks[0].targetCompletionDate = dateUtilService.yesterday
-        tasks[0].save(flush:true)
+        taskA.targetStartDate = dateUtilService.yesterday
+        taskA.targetCompletionDate = dateUtilService.yesterday
+        taskA.save(flush:true)
         assert taskSearchService.getTasks([:]).totalCount == taskCount - 1
 
+        // Yesterdays tasks should be returned, if we ask for them.
+        assert taskSearchService.getTasks([:], dateUtilService.yesterday, dateUtilService.tomorrow).totalCount == taskCount
+
         // Tasks that span today should be returned.
-        tasks[0].targetStartDate = dateUtilService.yesterday
-        tasks[0].targetCompletionDate = dateUtilService.tomorrow
-        tasks[0].save(flush:true)
+        taskA.targetStartDate = dateUtilService.yesterday
+        taskA.targetCompletionDate = dateUtilService.tomorrow
+        taskA.save(flush:true)
         assert taskSearchService.getTasks([:]).totalCount == taskCount
     } // testGetTasks()
