Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- behavior of "PartyApiV1 /parties/$partyId/users/$userId PUT - user update"
- it should "update all of a user's details" in { param =>
- val (route, authentication, assembly) = param
- val targetDomain = Parties.inDB.RR
- val targetParty = targetDomain.party
- val targetUser = targetDomain.userGRR
- val userUpdate = UserUpdate(
- title = Some("King of the Andals," +
- " the Rhoynar, and the First Men," +
- "Lord of the Seven Kingdoms," +
- "and Protector of the Realm"),
- initials = Some("E.G.G."),
- firstName = Some("Aegon"),
- lastName = Some("Targaryen"),
- roles = List(targetDomain.adminRole, targetDomain.userRole))
- Put(s"/parties/${targetParty.id }/users/${targetUser.id }", userUpdate) ~> authentication ~> route ~> check {
- response.status should equal(StatusCodes.OK)
- val updatedUser = responseAs[User]
- updatedUser.id should equal(targetUser.id)
- updatedUser.title should equal(userUpdate.title)
- updatedUser.initials should equal(userUpdate.initials)
- updatedUser.firstName should equal(userUpdate.firstName)
- updatedUser.lastName should equal(userUpdate.lastName)
- updatedUser.roles should equal(userUpdate.roles)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement