Ruby code test: mimic ActiveRecord validations