Hi all,
i have one problem. I’m just trying to get the
restful_authentication plugin work, but i discovered
that its rspec tests are not working, because of this:
it ‘requires password confirmation’ do
lambda do
u = Factory.create_user(:password_confirmation =>
nil)
u.errors.on(:password_confirmation).should_not
be_nil
end.should_not change(User, :count)
end
where in the user model i have a simple:
validates_presence_of :password_confirmation
Autotest continues to tell me that:
ActiveRecord::RecordInvalid in ‘User requires password
confirmation’
Validation failed: Password confirmation can’t be
blank
The question is: how can i test both the presence of
error and the change on count?
Thanks in advance,
Roberto.
Inviato da Yahoo! Mail.
Tanti modi per restare in contatto con chi vuoi.