Skip to content

Commit

Permalink
Confirmation validation + test
Browse files Browse the repository at this point in the history
  • Loading branch information
porras committed Oct 3, 2007
1 parent 57adc85 commit 2f7da85
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/live_validations.rb
Expand Up @@ -12,7 +12,8 @@ module Validations
:numericality => "Validate.Numericality",
:format => "Validate.Format",
:length => "Validate.Length",
:acceptance => "Validate.Acceptance"
:acceptance => "Validate.Acceptance",
:confirmation => "Validate.Confirmation"
}


Expand Down
7 changes: 7 additions & 0 deletions test/live_validations_test.rb
Expand Up @@ -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.