fix secure password and add tests for user model