From 69f3f81e6ca6ee7ce184f6eafaf4b1e1b78564c3 Mon Sep 17 00:00:00 2001 From: Aditya Kapoor Date: Tue, 1 Sep 2015 17:35:50 +0530 Subject: Add missing test for #17351 --- .../test/cases/validations/confirmation_validation_test.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'activemodel/test/cases') 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 -- cgit v1.2.3