Add test to make sure that pattern component is disable by default

This commit is contained in:
Rafael Mendonça França 2012-01-11 18:57:01 -03:00
parent 8d5dcfde43
commit c891667501
1 changed files with 5 additions and 0 deletions

View File

@ -72,6 +72,11 @@ class StringInputTest < ActionView::TestCase
assert_select 'input[type=password].password[placeholder=Password Confirmation]#user_password'
end
test 'input should not infer pattern from attributes by default' do
with_input_for @other_validating_user, :country, :string
assert_no_select 'input[pattern="\w+"]'
end
test 'input should infer pattern from attributes' do
with_input_for @other_validating_user, :country, :string, :pattern => true
assert_select 'input[pattern="\w+"]'