aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_tag_helper_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/template/form_tag_helper_test.rb')
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb20
1 files changed, 15 insertions, 5 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index 868a35c476..3b8760351e 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -8,11 +8,15 @@ class FormTagHelperTest < ActionView::TestCase
def setup
super
- @controller = Class.new(BasicController) do
- def url_for(options)
- "http://www.example.com"
- end
- end.new
+ @controller = BasicController.new
+ end
+
+ def url_for(options)
+ if options.is_a?(Hash)
+ "http://www.example.com"
+ else
+ super
+ end
end
VALID_HTML_ID = /^[A-Za-z][-_:.A-Za-z0-9]*$/ # see http://www.w3.org/TR/html4/types.html#type-name
@@ -158,6 +162,12 @@ class FormTagHelperTest < ActionView::TestCase
assert_dom_equal expected, actual
end
+ def test_select_tag_with_array_options
+ assert_deprecated /array/ do
+ select_tag "people", ["<option>david</option>"]
+ end
+ end
+
def test_text_area_tag_size_string
actual = text_area_tag "body", "hello world", "size" => "20x40"
expected = %(<textarea cols="20" id="body" name="body" rows="40">hello world</textarea>)