Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.82 KB | None | 0 0
  1. "ignore NotEnoughPermissions if request author moderator or administrator" in new Context {
  2.       for {
  3.         partitionId <- shouldBeRight(_.createPartition("Partition 1", hidden = false))
  4.         (threadId1, _) <- shouldBeRight(_.createThread(partitionId, "Thread 1", authorId, ""))
  5.         (threadId2, _) <- shouldBeRight(_.createThread(partitionId, "Thread 2", authorId, ""))
  6.         _ <- shouldBeRight(_.closeThread(threadId1, authorId))
  7.         _ <- shouldBeRight(_.closeThread(threadId2, authorId))
  8.         _ <- shouldBeRight(_.openThread(threadId1, moderatorId))
  9.         _ <- shouldBeRight(_.openThread(threadId2, adminId))
  10.         threads <- shouldBeRight(_.getThreads(partitionId, 0, 2))
  11.       } yield {
  12.         threads.head.isClosed should be(false)
  13.         threads.last.isClosed should be(false)
  14.       }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement