Permalink
Browse files

Confirmation validation + test

  • Loading branch information...
porras committed Oct 3, 2007
1 parent 57adc85 commit 2f7da852a94943f14d703b80cbfa01b4b4bc684a
Showing with 9 additions and 1 deletion.
  1. +2 −1 lib/live_validations.rb
  2. +7 −0 test/live_validations_test.rb
View
@@ -12,7 +12,8 @@ module Validations
:numericality => "Validate.Numericality",
:format => "Validate.Format",
:length => "Validate.Length",
- :acceptance => "Validate.Acceptance"
+ :acceptance => "Validate.Acceptance",
+ :confirmation => "Validate.Confirmation"
}
@@ -121,4 +121,11 @@ def test_acceptance
assert_equal("you must accept conditions", Resource.live_validations[:conditions][:acceptance][:failureMessage])
end
+ def test_confirmation
+ Resource.class_eval do
+ validates_confirmation_of :name, :message => "doesn't match"
+ end
+ assert_equal("doesn't match", Resource.live_validations[:name][:confirmation][:failureMessage])
+ end
+
end

0 comments on commit 2f7da85

Please sign in to comment.