I have a basic user class and doing rspec validations.  When I do a factory 
create to produce validations it blows up before I can get to the second 
line to check for errors.  Ideas how to get this to perform like AR 
Validations?

MongoMapper::DocumentNotValid:
       Validation failed: Password can't be blank, Email can't be blank, 
Password digest can't be blank

class User
  include MongoMapper::Document
  include ActiveModel::SecurePassword
  
  attr_accessible :email, :password
  
  key :password_digest, String
  key :password, String, :required => true
  key :email, String, :required => true
      
  has_secure_password
end

it "should not authenticate with incorrect password" do
      user = Factory(:user, :email=> '', :password => '').should 
have(2).errors
      #user.should have(2).errors #_on(:name)
  end
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to