I'm still pretty confused about what is magic behind stuff like it { should have(1).error_on(:base) }
and what's a specific Shoulda matcher.
I'd like to make sure that :base
contains the error message "xxx", so how should I do this?
it "should contain error message 'xxx'" do
contact.valid?
contact.errors[:base].should include('xxx')
end
Is this "the way to go", or is there a better one? Thanks.