If I have this line in my model:
validates_presence_of :name, :message => "Please enter a name"
and I test this with the following code:
def test_should_require_name
user= User.new(valid_user_attributes(:name => ""))
assert !applicant.save
end
Is there a way to write an additional test to ensure that not only the
name field may not be blank, but that if it is blank the message "Please
neter a name" is thrown?
Thanks for the tip.
I'm currently reading a book "Professional Webdevelopment with RoR2" by
Jens-Christian Fischer and he's just getting into Rspec.
I wasn't sure how indepth I should read that part, but now I will
definitely take the time to check it out.