Samuel Johnson
2005-Jun-25 03:23 UTC
Agile Book - p.151 test_login_with_invalid_user() NameError: uninitialized constant SHA1
When running ruby test/functional/login_controller_test.rb I get this: 1) Error: test_login_with_invalid_user(LoginControllerTest): NameError: uninitialized constant SHA1 /usr/lib/ruby/gems/1.8/gems/activesupport-1.0.4.1490/lib/active_support/dependencies.rb:182:in `const_missing'' ./test/functional/../../config/..//app/models/user.rb:34:in `hash_password'' ./test/functional/../../config/..//app/models/user.rb:14:in `login'' ./test/functional/../../config/..//app/models/user.rb:20:in `try_to_login'' ./test/functional/../../config/..//app/controllers/login_controller.rb:16:in `login'' <snip> my hash_password() looks like this (right out of the example) def self.hash_password(password) Digest::SHA1.hexdigest(password) end does SHA1 appear to be a constant because it''s all upper-case? Am I just braindead? I''m running actionpack-1.8.1.1490 which should be the latest. -sam
David Balmain
2005-Jun-25 03:48 UTC
Re: Agile Book - p.151 test_login_with_invalid_user() NameError: uninitialized constant SHA1
> my hash_password() looks like this (right out of the example) > > def self.hash_password(password) > Digest::SHA1.hexdigest(password) > endDo you have; require "digest/sha1" Check on page 121. Hope that helps. :) Dave
Samuel Johnson
2005-Jun-25 06:27 UTC
Agile Book - p.151 test_login_with_invalid_user() NameError: uninitialized constant SHA1
Well I''m impressed. Seems strange that the code would work when the test fails. Also: Are you psychic? If so, I have an off-by-one error in a GIMP(lisp) script for you to fix ;-) thanks, -sam On 6/24/05, David Balmain <dbalmain.ml-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > my hash_password() looks like this (right out of the example) > > > > def self.hash_password(password) > > Digest::SHA1.hexdigest(password) > > end > Do you have; > > require "digest/sha1" > > Check on page 121. Hope that helps. :) > > Dave >