From c89166750190e2694bdd8763de9529a1dbba3dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 11 Jan 2012 18:57:01 -0300 Subject: [PATCH] Add test to make sure that pattern component is disable by default --- test/inputs/string_input_test.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/inputs/string_input_test.rb b/test/inputs/string_input_test.rb index 6abe35a0..248e8987 100644 --- a/test/inputs/string_input_test.rb +++ b/test/inputs/string_input_test.rb @@ -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+"]'