Skip to content
This repository has been archived by the owner on Apr 27, 2023. It is now read-only.

Commit

Permalink
test case for deleta a user and should not show in the list
Browse files Browse the repository at this point in the history
  • Loading branch information
gmkumar2005 committed Dec 11, 2014
1 parent 5411669 commit de9298d
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,24 @@ class SQLUserDAOSpec extends FlatSpecWithSQL with ClearSQLDataAfterTest with Bef
// then
assert(deletedUser === None , "Deletion was attempted but found " + deletedUser)
}
it should "deleta a user and should not show in the list " taggedAs RequiresDb in {
// given
val user = UserAssembler.randomUser.withBasicAuth("user", "pass").withAdmin(set = false).withActive(set = false).get
userDAO.add(user)
val newAuth = Authentication.basic(user.authentication.username, "newpass")

// when
val tobeDeletedUser = user.copy(authentication = newAuth, admin = true, active = true)
val userCountBeforeDelete = userDAO.findAll().length
userDAO.delete(tobeDeletedUser.id)
val deletedUser = userDAO.findById(user.id)
val userCountAfterDelete = userDAO.findAll().length
// then
assert(deletedUser === None , "Deletion was attempted but found " + deletedUser)
userCountAfterDelete should be(userCountBeforeDelete -1)

}

"rememberNotifications" should "store dates properly" taggedAs RequiresDb in {
// given
val user = UserAssembler.randomUser.get
Expand Down

0 comments on commit de9298d

Please sign in to comment.