diff options
author | francis <francis> | 2007-11-07 10:30:38 +0000 |
---|---|---|
committer | francis <francis> | 2007-11-07 10:30:38 +0000 |
commit | f960ed63373647a2c0d9929016d8b5647856d865 (patch) | |
tree | e783e2bd9f7a66b97e2b7071be0c1d4b024b33b5 /spec/models/user_spec.rb | |
parent | 43026e0bf80aa1a1e97639269c3adb56f45cef54 (diff) |
Update test code.
Diffstat (limited to 'spec/models/user_spec.rb')
-rw-r--r-- | spec/models/user_spec.rb | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 5e9e89a1a..11e906b6b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -17,18 +17,19 @@ describe User, " when authenticating" do @empty_user.hashed_password.should_not be_nil end - it "should not find the user when given the wrong password" do - found_user = User.authenticate("sensible@localhost", "iownzyou") - found_user.should be_nil + it "should have errors when given the wrong password" do + found_user = User.authenticate_from_form({ :email => "sensible@localhost", :password => "iownzyou" }) + found_user.errors.size.should > 0 end it "should not find the user when given the wrong email" do - found_user = User.authenticate("soccer@localhost", "foolishpassword") - found_user.should be_nil + found_user = User.authenticate_from_form( { :email => "soccer@localhost", :password => "foolishpassword" }) + found_user.errors.size.should > 0 end it "should find the user when given the right email and password" do - found_user = User.authenticate("sensible@localhost", "foolishpassword") + found_user = User.authenticate_from_form( { :email => "sensible@localhost", :password => "foolishpassword" }) + found_user.errors.size.should == 0 found_user.should == (@full_user) end |