Advertisement
Guest User

Untitled

a guest
Sep 8th, 2014
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 1.23 KB | None | 0 0
  1. behavior of "PartyApiV1 /parties/$partyId/users/$userId PUT - user update"
  2.  
  3.   it should "update all of a user's details" in { param =>
  4.     val (route, authentication, assembly) = param
  5.     val targetDomain = Parties.inDB.RR
  6.     val targetParty = targetDomain.party
  7.     val targetUser = targetDomain.userGRR
  8.     val userUpdate = UserUpdate(
  9.       title = Some("King of the Andals," +
  10.         " the Rhoynar, and the First Men," +
  11.         "Lord of the Seven Kingdoms," +
  12.         "and Protector of the Realm"),
  13.       initials = Some("E.G.G."),
  14.       firstName = Some("Aegon"),
  15.       lastName = Some("Targaryen"),
  16.       roles = List(targetDomain.adminRole, targetDomain.userRole))
  17.  
  18.     Put(s"/parties/${targetParty.id }/users/${targetUser.id }", userUpdate) ~> authentication ~> route ~> check {
  19.       response.status should equal(StatusCodes.OK)
  20.       val updatedUser = responseAs[User]
  21.       updatedUser.id should equal(targetUser.id)
  22.       updatedUser.title should equal(userUpdate.title)
  23.       updatedUser.initials should equal(userUpdate.initials)
  24.       updatedUser.firstName should equal(userUpdate.firstName)
  25.       updatedUser.lastName should equal(userUpdate.lastName)
  26.       updatedUser.roles should equal(userUpdate.roles)
  27.     }
  28.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement