From 2ffa50f5a9fac08e08869687006031b70322497a Mon Sep 17 00:00:00 2001 From: Neeraj Singh Date: Fri, 20 Aug 2010 10:17:29 -0400 Subject: after_validation should be called irrespective of the result of validation. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I confirmed that this is the behavior on 2.3.x . [5419 state:resolved] Signed-off-by: José Valim --- activemodel/test/cases/validations_test.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activemodel/test/cases') diff --git a/activemodel/test/cases/validations_test.rb b/activemodel/test/cases/validations_test.rb index f9fc6613f4..1eed0b0c4d 100644 --- a/activemodel/test/cases/validations_test.rb +++ b/activemodel/test/cases/validations_test.rb @@ -25,9 +25,11 @@ class ValidationsTest < ActiveModel::TestCase r = Reply.new r.title = "There's no content!" assert r.invalid?, "A reply without content shouldn't be saveable" + assert r.after_validation_performed, "after_validation callback should be called" r.content = "Messa content!" assert r.valid?, "A reply with content should be saveable" + assert r.after_validation_performed, "after_validation callback should be called" end def test_single_attr_validation_and_error_msg -- cgit v1.2.3