module Shoulda::Matchers::ActiveModel

def validate_absence_of(attr)

with_message(/may not be set/) }
it { should validate_absence_of(:name).
it { should validate_absence_of(:name) }
Examples:

Defaults to the translation for :present.
errors.on(:attribute). Regexp or String.
* with_message - value the test expects to find in
Options:

Ensures that the model is not valid if the given attribute is present.
def validate_absence_of(attr)
  ValidateAbsenceOfMatcher.new(attr)
end