diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-09-01 15:01:09 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-09-01 15:01:09 +0200 |
commit | 2c271296f55e4397f2e71f8060d8c1c88c2db8a4 (patch) | |
tree | 61ff7ffc3dc590cffd73a17688a9f63ab6843a9b /activemodel | |
parent | 4a34915d401f83e1227a5615bc6014cb8973de47 (diff) | |
parent | 69f3f81e6ca6ee7ce184f6eafaf4b1e1b78564c3 (diff) | |
download | rails-2c271296f55e4397f2e71f8060d8c1c88c2db8a4.tar.gz rails-2c271296f55e4397f2e71f8060d8c1c88c2db8a4.tar.bz2 rails-2c271296f55e4397f2e71f8060d8c1c88c2db8a4.zip |
Merge pull request #21447 from aditya-kapoor/add-missing-test-am
Add missing test for #17351
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/test/cases/validations/confirmation_validation_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activemodel/test/cases/validations/confirmation_validation_test.rb b/activemodel/test/cases/validations/confirmation_validation_test.rb index c1431548f7..c56bf1c0ad 100644 --- a/activemodel/test/cases/validations/confirmation_validation_test.rb +++ b/activemodel/test/cases/validations/confirmation_validation_test.rb @@ -104,4 +104,18 @@ class ConfirmationValidationTest < ActiveModel::TestCase assert_equal "expected title", model.title_confirmation, "confirmation validation should not override the writer" end + + def test_title_confirmation_with_case_sensitive_option_true + Topic.validates_confirmation_of(:title, case_sensitive: true) + + t = Topic.new(title: "title", title_confirmation: "Title") + assert t.invalid? + end + + def test_title_confirmation_with_case_sensitive_option_false + Topic.validates_confirmation_of(:title, case_sensitive: false) + + t = Topic.new(title: "title", title_confirmation: "Title") + assert t.valid? + end end |