Skip to content

Commit

Permalink
formatting, and fix test to allow task in bundle to be unlocked
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Mar 11, 2024
1 parent b84ed13 commit f394514
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame
)

val response =
this.service.createTaskBundle(User.superUser, "my bundle",Some(0), List(task1.id, task2.id))
this.service.createTaskBundle(User.superUser, "my bundle", Some(0), List(task1.id, task2.id))
response.taskIds.length mustEqual 2

// tasks.bundle_id is NOT set until setTaskStatus is called!!!
Expand All @@ -58,7 +58,7 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame
"not create a task Bundle with no tasks" taggedAs (TaskTag) in {
// Cannot create a bundle with no tasks
intercept[InvalidException] {
this.service.createTaskBundle(User.superUser, "my bundle again",Some(0), List())
this.service.createTaskBundle(User.superUser, "my bundle again", Some(0), List())
}
}

Expand Down Expand Up @@ -110,7 +110,7 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame
)

val bundle =
this.service.createTaskBundle(User.superUser, "my bundle for get",Some(0), List(task1.id, task2.id))
this.service.createTaskBundle(User.superUser, "my bundle for get", Some(0), List(task1.id, task2.id))

val response = this.service.getTaskBundle(User.superUser, bundle.bundleId)
response.bundleId mustEqual bundle.bundleId
Expand All @@ -130,7 +130,7 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame
)

val bundle = this.service
.createTaskBundle(User.superUser, "my bundle for delete",Some(0), List(task1.id, task2.id))
.createTaskBundle(User.superUser, "my bundle for delete", Some(0), List(task1.id, task2.id))

// tasks.bundle_id is NOT set until setTaskStatus is called
taskDAL.setTaskStatus(
Expand Down Expand Up @@ -159,7 +159,7 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame
)

val bundle = this.service
.createTaskBundle(User.superUser, "my bundle for delete",Some(0), List(task1.id, task2.id))
.createTaskBundle(User.superUser, "my bundle for delete", Some(0), List(task1.id, task2.id))

// tasks.bundle_id is NOT set until setTaskStatus is called
taskDAL.setTaskStatus(
Expand Down Expand Up @@ -193,7 +193,7 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame
)

val bundle = this.service
.createTaskBundle(User.superUser, "my bundle for unbundle",Some(0), List(task1.id, task2.id))
.createTaskBundle(User.superUser, "my bundle for unbundle", Some(0), List(task1.id, task2.id))

// tasks.bundle_id is NOT set until setTaskStatus is called
taskDAL.setTaskStatus(
Expand All @@ -204,7 +204,7 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame
primaryTaskId = Some(task1.id)
)

this.service.unbundleTasks(User.superUser, bundle.bundleId, List(task2.id), List(task2.id))()
this.service.unbundleTasks(User.superUser, bundle.bundleId, List(task1.id), List(task2.id))()
val response = this.service.getTaskBundle(User.superUser, bundle.bundleId)
response.taskIds.length mustEqual 1
response.taskIds.head mustEqual task1.id
Expand Down Expand Up @@ -241,7 +241,7 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame

// Random user is not allowed to delete this bundle
an[IllegalAccessException] should be thrownBy
this.service.unbundleTasks(randomUser, bundle.bundleId, List(task2.id), List(task2.id))()
this.service.unbundleTasks(randomUser, bundle.bundleId, List(task1.id), List(task2.id))()
}

}
Expand Down

0 comments on commit f394514

Please sign in to comment.