Sha256: 0d66b5c37a1dde94e0d01eb8a78312e463b37aca5c95834aacf7e94962857aa5

Contents?: true

Size: 1.06 KB

Versions: 32

Compression:

Stored size: 1.06 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../test_helper')

Expectations do
  
  expect false do
    validation = Validatable::ValidatesPresenceOf.new stub_everything, :name
    validation.valid?(stub_everything)
  end
  
  expect true do
    validation = Validatable::ValidatesPresenceOf.new stub_everything, :name
    validation.valid?(stub(:name=>"book"))
  end
  
  expect true do
    validation = Validatable::ValidatesPresenceOf.new stub_everything, :name, :allow_nil => true
    validation.valid?(stub(:name=>nil))
  end
  
  expect true do
    validation = Validatable::ValidatesPresenceOf.new stub_everything, :name, :allow_blank => true
    validation.valid?(stub(:name=>''))
  end
  
  expect true do
    validation = Validatable::ValidatesPresenceOf.new stub_everything, :employee
    validation.valid?(stub(:employee => stub(:nil? => false)))
  end
  
  expect true do
    options = {:message => nil, :if => nil, :times => nil, :level => nil, :groups => nil}
    Validatable::ValidatesPresenceOf.new(stub_everything, :test).must_understand(options)
  end
  
end

Version data entries

32 entries across 32 versions & 9 rubygems

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