Skip to content

Commit

Permalink
remove test because it is no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
CollinBeczak committed Mar 11, 2024
1 parent f77451d commit 8f56fb2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 40 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,11 +254,10 @@ class TaskBundleController @Inject() (
* @param id The id for the bundle
* @return Task Bundle
*/
def getTaskBundle(id: Long): Action[AnyContent] = Action.async {
implicit request =>
this.sessionManager.authenticatedRequest { implicit user =>
Ok(Json.toJson(this.serviceManager.taskBundle.getTaskBundle(user, id)))
}
def getTaskBundle(id: Long): Action[AnyContent] = Action.async { implicit request =>
this.sessionManager.authenticatedRequest { implicit user =>
Ok(Json.toJson(this.serviceManager.taskBundle.getTaskBundle(user, id)))
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class TaskBundleService @Inject() (
throw new NotFoundException(s"Task Bundle not found with id ${bundleId}.")
}

TaskBundle(bundleId, ownerId.get, tasks.map(task => {
TaskBundle(bundleId, ownerId.get, tasks.map(task => {
task.id
}), Some(tasks))
}
Expand Down
34 changes: 0 additions & 34 deletions test/org/maproulette/framework/service/TaskBundleServiceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -210,40 +210,6 @@ class TaskBundleServiceSpec(implicit val application: Application) extends Frame
response.taskIds.head mustEqual task1.id
}

"unbundle a task with permission check" taggedAs (TaskTag) in {
val task1 = taskDAL
.insert(
getTestTask(UUID.randomUUID().toString, challenge.id),
User.superUser
)
var task2 = taskDAL
.insert(
getTestTask(UUID.randomUUID().toString, challenge.id),
User.superUser
)

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

// tasks.bundle_id is NOT set until setTaskStatus is called
taskDAL.setTaskStatus(
List(task1, task2),
Task.STATUS_FIXED,
User.superUser,
bundleId = Some(bundle.bundleId),
primaryTaskId = Some(task1.id)
)

val randomUser = serviceManager.user.create(
this.getTestUser(1022345, "RandomOUser2"),
User.superUser
)

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

}

override implicit val projectTestName: String = "TaskBundleSpecProject"
Expand Down

0 comments on commit 8f56fb2

Please sign in to comment.