From 523d54b56d612a791f16468ae3776ac12fd71bb7 Mon Sep 17 00:00:00 2001 From: Thomas Fuchs Date: Tue, 21 Feb 2006 10:52:35 +0000 Subject: Added various InPlaceEditor options, #3746, #3891, #3896, #3906 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3626 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../template/java_script_macros_helper_test.rb | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/java_script_macros_helper_test.rb b/actionpack/test/template/java_script_macros_helper_test.rb index ae3069ccb5..1a18c00e72 100644 --- a/actionpack/test/template/java_script_macros_helper_test.rb +++ b/actionpack/test/template/java_script_macros_helper_test.rb @@ -53,4 +53,42 @@ class JavaScriptMacrosHelperTest < Test::Unit::TestCase assert_dom_equal %(
), text_field_with_auto_complete(:message, :recipient, {}, :skip_style => true) end + + def test_in_place_editor_external_control + assert_dom_equal %(), + in_place_editor('some_input', {:url => {:action => 'inplace_edit'}, :external_control => 'blah'}) + end + + def test_in_place_editor_size + assert_dom_equal %(), + in_place_editor('some_input', {:url => {:action => 'inplace_edit'}, :size => 4}) + end + + def test_in_place_editor_cols_no_rows + assert_dom_equal %(), + in_place_editor('some_input', {:url => {:action => 'inplace_edit'}, :cols => 4}) + end + + def test_in_place_editor_cols_with_rows + assert_dom_equal %(), + in_place_editor('some_input', {:url => {:action => 'inplace_edit'}, :rows => 5, :cols => 40}) + end + + def test_inplace_editor_loading_text + assert_dom_equal %(), + in_place_editor('some_input', {:url => {:action => 'inplace_edit'}, :loading_text => 'Why are we waiting?'}) + end + + def test_in_place_editor_url + assert_match "Ajax.InPlaceEditor('id-goes-here', 'http://www.example.com/action_to_set_value')", + in_place_editor( 'id-goes-here', :url => { :action => "action_to_set_value" }) + end + + def test_in_place_editor_load_text_url + assert_match "Ajax.InPlaceEditor('id-goes-here', 'http://www.example.com/action_to_set_value', {loadTextURL:'http://www.example.com/action_to_get_value'})", + in_place_editor( 'id-goes-here', + :url => { :action => "action_to_set_value" }, + :load_text_url => { :action => "action_to_get_value" }) + end + end -- cgit v1.2.3