Changeset 745
- Timestamp:
- Dec 14, 2010, 4:43:34 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/integration/TaskSearchServiceTests.groovy
r640 r745 215 215 assert taskSearchService.getPersonsTasks(params, Person.get(2)).totalCount == 2 // taskA and taskB. 216 216 217 } // testGetTasks() 218 219 void testGetBudgetTasks() { 220 221 def tasks 222 def params = [:] 223 def today = dateUtilService.today 224 def yesterday = dateUtilService.yesterday 225 def tomorrow = dateUtilService.tomorrow 226 def unplanned = TaskBudgetStatus.read(1) 227 def planned = TaskBudgetStatus.read(2) 228 229 assert planned != null 230 assert unplanned != null 231 232 // Default is to return planned. 233 // TaskA and taskB should be unplanned and therefore not returned. 234 tasks = taskSearchService.getBudgetTasks(params) 235 assert tasks.totalCount == 0 236 tasks = taskSearchService.getBudgetTasks(params, planned) 237 assert tasks.totalCount == 0 238 239 tasks = taskSearchService.getBudgetTasks(params, unplanned) 240 assert tasks.totalCount == taskCount 241 assert tasks.contains(taskA) 242 assert tasks.contains(taskB) 243 244 // Planned tasks are returned. 245 taskA.taskBudgetStatus = planned 246 taskA.save(flush:true) 247 tasks = taskSearchService.getBudgetTasks(params, planned) 248 assert tasks.totalCount == 1 249 assert tasks.contains(taskA) 250 251 // Tasks are returned when dates and budget status are specified. 252 tasks = taskSearchService.getBudgetTasks(params, planned, today, tomorrow) 253 assert tasks.totalCount == 1 254 assert tasks.contains(taskA) 255 tasks = taskSearchService.getBudgetTasks(params, unplanned, today, tomorrow) 256 assert tasks.totalCount == 1 257 assert tasks.contains(taskB) 258 259 // No tasks for yesterday 260 tasks = taskSearchService.getBudgetTasks(params, null, yesterday, today) 261 assert tasks.totalCount == 0 262 263 // Tasks that span today are returned. 264 taskA.targetStartDate = yesterday 265 taskA.targetCompletionDate = tomorrow+2 266 taskA.save(flush:true) 267 tasks = taskSearchService.getBudgetTasks(params, planned, today, tomorrow) 268 assert tasks.totalCount == 1 269 assert tasks.contains(taskA) 270 271 } // testGetBudgetTasks() 217 } // testGetPersonsTasks() 272 218 273 219 } // end class
Note: See TracChangeset
for help on using the changeset viewer.