mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #21447 from aditya-kapoor/add-missing-test-am
Add missing test for #17351
This commit is contained in:
commit
2c271296f5
1 changed files with 14 additions and 0 deletions
|
@ -104,4 +104,18 @@ class ConfirmationValidationTest < ActiveModel::TestCase
|
||||||
assert_equal "expected title", model.title_confirmation,
|
assert_equal "expected title", model.title_confirmation,
|
||||||
"confirmation validation should not override the writer"
|
"confirmation validation should not override the writer"
|
||||||
end
|
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
|
end
|
||||||
|
|
Loading…
Reference in a new issue