thoughtbot/shoulda-matchers — Issue #44: Add more parameters to ValidateNumericalityOfMatcher
Author: moffff
Created: 2011-12-21 04:04:55+00:00
State: open

it { should validate_numericality_of(:age).greater_than(18) }
it { should validate_numericality_of(:age).greater_than(18).with_greater_than_message('custom message') }
it { should validate_numericality_of(:age).less_than(300) }
it { should validate_numericality_of(:age).less_than(300).with_less_than_message('custom message') }
it { should validate_numericality_of(:age).greater_than_or_equal_to(18) }
it { should validate_numericality_of(:age).greater_than_or_equal_to(18).with_greater_than_or_equal_to_message('custom message') }
it { should validate_numericality_of(:age).less_than_or_equal_to(300) }
it { should validate_numericality_of(:age).less_than_or_equal_to(300).with_less_than_or_equal_to_message('custom message') }
it { should validate_numericality_of(:age).equal_to(25) }
it { should validate_numericality_of(:age).equal_to(25).with_equal_to_message('custom message') }