mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add test for allow_blank in numericality validation
Signed-off-by: Guillermo Iguaran <guilleiguaran@gmail.com>
This commit is contained in:
parent
f3f8589f77
commit
43f1b23a75
1 changed files with 7 additions and 0 deletions
|
@ -35,6 +35,13 @@ class NumericalityValidationTest < ActiveModel::TestCase
|
|||
valid!(NIL + FLOATS + INTEGERS + BIGDECIMAL + INFINITY)
|
||||
end
|
||||
|
||||
def test_validates_numericality_of_with_blank_allowed
|
||||
Topic.validates_numericality_of :approved, allow_blank: true
|
||||
|
||||
invalid!(JUNK)
|
||||
valid!(NIL + BLANK + FLOATS + INTEGERS + BIGDECIMAL + INFINITY)
|
||||
end
|
||||
|
||||
def test_validates_numericality_of_with_integer_only
|
||||
Topic.validates_numericality_of :approved, only_integer: true
|
||||
|
||||
|
|
Loading…
Reference in a new issue