Sha256: 4c61408fe49737f6c52b41172867c12479de63ab8989d98051bf2d675f47e2a1
Contents?: true
Size: 949 Bytes
Versions: 3
Compression:
Stored size: 949 Bytes
Contents
require File.expand_path(File.dirname(__FILE__) + '/../test_helper') class ValidatesPresenceOfTest < Test::Unit::TestCase test "when attribute value does not match the given regex, then valid is false" do validation = Validatable::ValidatesPresenceOf.new :name assert_equal false, validation.valid?(stub_everything) end test "when attribute value does match the given regex, then valid is true" do validation = Validatable::ValidatesPresenceOf.new :name assert_equal true, validation.valid?(stub(:name=>"book")) end test "when given a true value which is not a String, then valid is true" do validation = Validatable::ValidatesPresenceOf.new :employee assert_equal true, validation.valid?(stub(:employee => stub(:nil? => false))) end expect true do Validatable::ValidatesPresenceOf.new(:test).must_understand(:message => nil, :if => nil, :times => nil, :level => nil, :groups => nil) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
validatable-1.3.0 | test/unit/validates_presence_of_test.rb |
validatable-1.3.2 | test/unit/validates_presence_of_test.rb |
validatable-1.3.4 | test/unit/validates_presence_of_test.rb |