diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-01-12 12:06:00 -0700 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-01-12 12:06:00 -0700 |
commit | 72570ea289ca96edbc074c3aadb2be2b214303af (patch) | |
tree | 4d4a62bc2679871216805fa1bf06272291abd9bd /activemodel/test/cases/validations | |
parent | 0fee2d4085eb70fe7c15d5ddc2a378b93b815ab9 (diff) | |
parent | 140557e85fc43ef5cff81a3af748605a6870f45b (diff) | |
download | rails-72570ea289ca96edbc074c3aadb2be2b214303af.tar.gz rails-72570ea289ca96edbc074c3aadb2be2b214303af.tar.bz2 rails-72570ea289ca96edbc074c3aadb2be2b214303af.zip |
Merge pull request #18439 from mokhan/validates-acceptance-of-array
allow '1' or true for acceptance validation.
Diffstat (limited to 'activemodel/test/cases/validations')
-rw-r--r-- | activemodel/test/cases/validations/acceptance_validation_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activemodel/test/cases/validations/acceptance_validation_test.rb b/activemodel/test/cases/validations/acceptance_validation_test.rb index e78aa1adaf..b7872ea6bf 100644 --- a/activemodel/test/cases/validations/acceptance_validation_test.rb +++ b/activemodel/test/cases/validations/acceptance_validation_test.rb @@ -65,4 +65,10 @@ class AcceptanceValidationTest < ActiveModel::TestCase ensure Person.clear_validators! end + + def test_validates_acceptance_of_true + Topic.validates_acceptance_of(:terms_of_service) + + assert Topic.new(terms_of_service: true).valid? + end end |