Closed nadeemkhedr closed 8 years ago
Hi there, thanks for reporting this.
Have you tried passing allow_blank: true
on your email validator? Does it change anything?
it works when using allow_blank
.
that said, the rest of the validations works a little different, even if the properties are required and I don't provide them when instantiating the object, the test just works.
Shoulda tests the validations itself not the actual values in the object
I'm closing this but feel free to reopen if you think I should do something here. Feels like a shoulda-matchers
limitation IMHO, but maybe I'm overlooking something :smile:
Thanks for reporting this in any case!
User Model
User Spec
Call Stack
All tests are passing except the
ensure_length_of
and its forpassword
notemail
To fix this. when i am instantiating the user in the test I have to provide an email
before(:each) { @user = User.new(email: 'user@example.com') }