diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-10-24 03:06:57 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-10-24 03:06:57 +0000 |
commit | f7c916ece661ac0d5936ca47f83ebfbf4852a8bb (patch) | |
tree | 98616b4ae6871bc0a64d4a56bcc21c399884c321 /actionpack/test | |
parent | e407b44ba14e5ab72f25ca107291e7a4d51051b8 (diff) | |
download | rails-f7c916ece661ac0d5936ca47f83ebfbf4852a8bb.tar.gz rails-f7c916ece661ac0d5936ca47f83ebfbf4852a8bb.tar.bz2 rails-f7c916ece661ac0d5936ca47f83ebfbf4852a8bb.zip |
Added block-usage to PrototypeHelper#form_remote_tag, document block-usage of FormTagHelper#form_tag [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5346 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_helper_test.rb | 2 | ||||
-rw-r--r-- | actionpack/test/template/form_tag_helper_test.rb | 4 | ||||
-rw-r--r-- | actionpack/test/template/prototype_helper_test.rb | 8 |
3 files changed, 10 insertions, 4 deletions
diff --git a/actionpack/test/template/form_helper_test.rb b/actionpack/test/template/form_helper_test.rb index 14605b8abc..c177a3db22 100644 --- a/actionpack/test/template/form_helper_test.rb +++ b/actionpack/test/template/form_helper_test.rb @@ -256,7 +256,7 @@ class FormHelperTest < Test::Unit::TestCase expected = "<form action='http://www.example.com' id='create-post' method='post'>" + - "<input name='_method' type='hidden' value='put' />" + + "<div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div>" + "<input name='post[title]' size='30' type='text' id='post_title' value='Hello World' />" + "<textarea name='post[body]' id='post_body' rows='20' cols='40'>Back to the hill and over it again!</textarea>" + "<input name='post[secret]' checked='checked' type='checkbox' id='post_secret' value='1' />" + diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index cfc95a5a08..df5e0f9e21 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -36,7 +36,7 @@ class FormTagHelperTest < Test::Unit::TestCase def test_form_tag_with_method actual = form_tag({}, { :method => :put }) - expected = %(<form action="http://www.example.com" method="post"><input type="hidden" name="_method" value="put" />) + expected = %(<form action="http://www.example.com" method="post"><div style='margin:0;padding:0'><input type="hidden" name="_method" value="put" /></div>) assert_dom_equal expected, actual end @@ -52,7 +52,7 @@ class FormTagHelperTest < Test::Unit::TestCase _erbout = '' form_tag("http://example.com", :method => :put) { _erbout.concat "Hello world!" } - expected = %(<form action="http://www.example.com" method="post"><input type="hidden" name="_method" value="put" />Hello world!</form>) + expected = %(<form action="http://www.example.com" method="post"><div style='margin:0;padding:0'><input type="hidden" name="_method" value="put" /></div>Hello world!</form>) assert_dom_equal expected, _erbout end diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb index 0364ceea62..256f057615 100644 --- a/actionpack/test/template/prototype_helper_test.rb +++ b/actionpack/test/template/prototype_helper_test.rb @@ -69,9 +69,15 @@ class PrototypeHelperTest < Test::Unit::TestCase end def test_form_remote_tag_with_method - assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"><input name='_method' type='hidden' value='put' />), + assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"><div style='margin:0;padding:0'><input name='_method' type='hidden' value='put' /></div>), form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast }, :html => { :method => :put }) end + + def test_form_remote_tag_with_block + _erbout = '' + form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast }) { _erbout.concat "Hello world!" } + assert_dom_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">Hello world!</form>), _erbout + end def test_on_callbacks callbacks = [:uninitialized, :loading, :loaded, :interactive, :complete, :success, :failure] |