diff options
author | José Valim <jose.valim@gmail.com> | 2010-01-11 23:37:48 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-01-11 23:38:35 +0100 |
commit | b078f7fd3910b0b174bc951cc8c0d27536b09c16 (patch) | |
tree | c12d709d1427e7acd0551b8d58fd1d1b88899a24 /activemodel/test/cases/validations/numericality_validation_test.rb | |
parent | cccb9988002f7b44133c089654b417ae9808b65f (diff) | |
download | rails-b078f7fd3910b0b174bc951cc8c0d27536b09c16.tar.gz rails-b078f7fd3910b0b174bc951cc8c0d27536b09c16.tar.bz2 rails-b078f7fd3910b0b174bc951cc8c0d27536b09c16.zip |
Fix typos and add tests to ensure they will be caught the next time.
Diffstat (limited to 'activemodel/test/cases/validations/numericality_validation_test.rb')
-rw-r--r-- | activemodel/test/cases/validations/numericality_validation_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activemodel/test/cases/validations/numericality_validation_test.rb b/activemodel/test/cases/validations/numericality_validation_test.rb index 75cd654f98..38b3f87e93 100644 --- a/activemodel/test/cases/validations/numericality_validation_test.rb +++ b/activemodel/test/cases/validations/numericality_validation_test.rb @@ -154,6 +154,14 @@ class NumericalityValidationTest < ActiveModel::TestCase Person.reset_callbacks(:validate) end + def test_validates_numericality_with_invalid_args + assert_raise(ArgumentError){ Topic.validates_numericality_of :approved, :greater_than_or_equal_to => "foo" } + assert_raise(ArgumentError){ Topic.validates_numericality_of :approved, :less_than_or_equal_to => "foo" } + assert_raise(ArgumentError){ Topic.validates_numericality_of :approved, :greater_than => "foo" } + assert_raise(ArgumentError){ Topic.validates_numericality_of :approved, :less_than => "foo" } + assert_raise(ArgumentError){ Topic.validates_numericality_of :approved, :equal_to => "foo" } + end + private def invalid!(values, error = nil) |