thoughtbot--shoulda-matchers/lib
Elliot Winkler 6173a160ac Validating presence of a secure password may raise an error
If you have a model that declares `has_secure_password` and you also
have a presence validation on the password, and you write a test against
this validation using an instance of your model where the password is
already set, then your test will fail. This is because
has_secure_password (at least on Rails 4) defines #password= such that
if it is given nil, then the password will not be overwritten with nil.
This interferes with how our validate_presence_of matcher works.

Unfortunately there is not a great way to get around this (using
\#write_attribute won't work, either). So in this case we raise a
helpful error message that instructs the user to use an empty record
against `validates_presence_of`.
2014-02-28 20:31:41 -07:00
..
shoulda Validating presence of a secure password may raise an error 2014-02-28 20:31:41 -07:00
shoulda-matchers.rb Switched to allowing a more canonical require statement 2011-01-31 16:45:13 -05:00