Sha256: 74f0761f79575c5ef2b6c9f8550eb8a9f7f9e0e25733a7be37e323283b76f1c0

Contents?: true

Size: 492 Bytes

Versions: 47

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 empty", instance.errors.on(:name)
    end
  end
end

Version data entries

47 entries across 47 versions & 10 rubygems

Version Path
hashrocket-validatable-1.7.2 test/functional/test_validates_presence_of.rb
hashrocket-validatable-1.7.4 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.7.0 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.7.1 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.7.2 test/functional/test_validates_presence_of.rb
vizjerai-validatable-1.8.0 test/functional/test_validates_presence_of.rb
vizjerai-validatable-1.9.0 test/functional/test_validates_presence_of.rb
lgustafson-validatable-1.8.7 test/functional/test_validates_presence_of.rb
lgustafson-validatable-1.8.6 test/functional/test_validates_presence_of.rb
np422-validatable-1.8.5 test/functional/test_validates_presence_of.rb
erotte-validatable-1.8.5 test/functional/test_validates_presence_of.rb
mattmatt-validatable-1.8.4 test/functional/test_validates_presence_of.rb
mattmatt-validatable-1.8.3 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.8.4 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.8.3 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.8.2 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.1.10 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.1.9 test/functional/test_validates_presence_of.rb
jnunemaker-validatable-1.8.1 test/functional/test_validates_presence_of.rb
durran-validatable-1.8.2 test/functional/test_validates_presence_of.rb