From f8a05ad297d637596d029b013bb65128ca0aa8bd Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 26 Mar 2011 14:44:36 -0700 Subject: Allow FormHelper#form_for to specify the :method as a direct option instead of through the :html hash [DHH] --- actionpack/test/template/form_helper_test.rb | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 359b078466..ff183d097d 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -715,14 +715,31 @@ class FormHelperTest < ActionView::TestCase assert_dom_equal expected, output_buffer end + def test_form_for_with_method_as_part_of_html_options + form_for(@post, :url => '/', :html => { :id => 'create-post', :method => :delete }) do |f| + concat f.text_field(:title) + concat f.text_area(:body) + concat f.check_box(:secret) + end + + expected = whole_form("/", "create-post", "edit_post", "delete") do + "" + + "" + + "" + + "" + end + + assert_dom_equal expected, output_buffer + end + def test_form_for_with_method - form_for(@post, :url => '/', :html => { :id => 'create-post', :method => :put }) do |f| + form_for(@post, :url => '/', :method => :delete, :html => { :id => 'create-post' }) do |f| concat f.text_field(:title) concat f.text_area(:body) concat f.check_box(:secret) end - expected = whole_form("/", "create-post", "edit_post", "put") do + expected = whole_form("/", "create-post", "edit_post", "delete") do "" + "" + "" + -- cgit v1.2.3 From cc6fa2f4d718c2d7a990fe23c38fc0ea4f2391d9 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 27 Mar 2011 11:20:54 -0700 Subject: Fix alias_method, add test --- actionpack/test/template/javascript_helper_test.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/javascript_helper_test.rb b/actionpack/test/template/javascript_helper_test.rb index 2e7484afaf..8aa2730da1 100644 --- a/actionpack/test/template/javascript_helper_test.rb +++ b/actionpack/test/template/javascript_helper_test.rb @@ -27,6 +27,7 @@ class JavaScriptHelperTest < ActionView::TestCase assert_equal %(This \\"thing\\" is really\\n netos\\'), escape_javascript(%(This "thing" is really\n netos')) assert_equal %(backslash\\\\test), escape_javascript( %(backslash\\test) ) assert_equal %(dont <\\/close> tags), escape_javascript(%(dont tags)) + assert_equal %(dont <\\/close> tags), j(%(dont tags)) end def test_button_to_function -- cgit v1.2.3 From 52351bcfeb833b00366f91e965c057f431b5a8aa Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Tue, 29 Mar 2011 09:40:42 -0300 Subject: Remove 'warning: ambiguous first argument' when running ActionPack tests Signed-off-by: Santiago Pastorino --- actionpack/test/template/date_helper_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb index aca2fef170..fd1f824a39 100644 --- a/actionpack/test/template/date_helper_test.rb +++ b/actionpack/test/template/date_helper_test.rb @@ -2720,11 +2720,11 @@ class DateHelperTest < ActionView::TestCase end def test_time_tag_pubdate_option - assert_match /.*<\/time>/, time_tag(Time.now, :pubdate => true) + assert_match(/.*<\/time>/, time_tag(Time.now, :pubdate => true)) end def test_time_tag_with_given_text - assert_match /Right now<\/time>/, time_tag(Time.now, 'Right now') + assert_match(/Right now<\/time>/, time_tag(Time.now, 'Right now')) end def test_time_tag_with_different_format -- cgit v1.2.3