test/functional/validatable_test.rb in validatable-1.4.0 vs test/functional/validatable_test.rb in validatable-1.5.0
- old
+ new
@@ -1,9 +1,9 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
module Functional
- class ValidatableTest < Test::Unit::TestCase
+ class ValidatableTest < Test::Unit::TestCase
expect ArgumentError do
Class.new do
include Validatable
attr_accessor :name
@@ -225,10 +225,22 @@
end
instance = klass.new
instance.valid_for_group_one?
end
- expect false do
+ expect true do
+ klass = Class.new do
+ include Validatable
+ validates_presence_of :name, :groups => :group_one
+ validates_presence_of :address
+ attr_accessor :name, :address
+ end
+ instance = klass.new
+ instance.address = 'anything'
+ instance.valid?
+ end
+
+ expect true do
klass = Class.new do
include Validatable
validates_presence_of :name, :groups => :group_one
attr_accessor :name
end
\ No newline at end of file