test/functional/validatable_test.rb in validatable-1.6.2 vs test/functional/validatable_test.rb in validatable-1.6.3
- old
+ new
@@ -1,8 +1,20 @@
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
functional_tests do
+ expect :is_set do
+ klass = Class.new do
+ include Validatable
+ attr_accessor :name, :result
+ validates_presence_of :name, :after_validate => lambda { |result, instance, attribute| instance.result = :is_set }
+ end
+
+ instance = klass.new
+ instance.valid?
+ instance.result
+ end
+
expect false do
klass = Class.new do
include Validatable
attr_accessor :name
validates_presence_of :name