Method: UserTest#test_check_password

Defined in:
lib/six-updater-web/vendor/plugins/goldberg/test/unit/user_test.rb

#test_check_passwordObject



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/six-updater-web/vendor/plugins/goldberg/test/unit/user_test.rb', line 82

def test_check_password
  first_pass = 'test'
  new_pass = 'test1'    
  first_pass.freeze
  new_pass.freeze
  
  assert_not_equal(first_pass, new_pass)
  
  user = Goldberg::User.new(:name => 'user')
  user.role =  @role
  user.clear_password = first_pass
  assert(user.save)
  
  assert(user.check_password(first_pass))
  assert(!user.check_password(new_pass))
  
  user.clear_password = new_pass
  assert(user.save)
  
  assert(user.check_password(new_pass))
  assert(!user.check_password(first_pass))
end