Sha256: 8171c1a14388313a1358c6e09619afe02e48f8432fa0f5f47806556001718322
Contents?: true
Size: 492 Bytes
Versions: 4
Compression:
Stored size: 492 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') module Functional class ValidatesPresenceOfTest < Test::Unit::TestCase test "given no name, when validated, then error is in the objects error collection" do klass = Class.new do include Validatable attr_accessor :name validates_presence_of :name end instance = klass.new instance.valid? assert_equal "can't be blank", instance.errors.on(:name) end end end
Version data entries
4 entries across 4 versions & 1 rubygems