aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorThomas Fuchs <thomas@fesch.at>2006-04-02 14:04:03 +0000
committerThomas Fuchs <thomas@fesch.at>2006-04-02 14:04:03 +0000
commit1fcc60895b9fa9d969649dca46b861fa38263b90 (patch)
tree592f17dd7b6bb1dd1a62e423c820648bb2131481 /actionpack/test
parenta3f20132dbdedefd1d0ac6c419df7d0af0dff638 (diff)
downloadrails-1fcc60895b9fa9d969649dca46b861fa38263b90.tar.gz
rails-1fcc60895b9fa9d969649dca46b861fa38263b90.tar.bz2
rails-1fcc60895b9fa9d969649dca46b861fa38263b90.zip
Add additional autocompleter options [aballai, Thomas Fuchs]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4131 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/template/java_script_macros_helper_test.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/test/template/java_script_macros_helper_test.rb b/actionpack/test/template/java_script_macros_helper_test.rb
index 59fe2398e5..da168f9ee5 100644
--- a/actionpack/test/template/java_script_macros_helper_test.rb
+++ b/actionpack/test/template/java_script_macros_helper_test.rb
@@ -31,8 +31,13 @@ class JavaScriptMacrosHelperTest < Test::Unit::TestCase
auto_complete_field("some_input", :url => { :action => "autocomplete" }, :tokens => [',']);
assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nvar some_input_auto_completer = new Ajax.Autocompleter('some_input', 'some_input_auto_complete', 'http://www.example.com/autocomplete', {minChars:3})\n//]]>\n</script>),
auto_complete_field("some_input", :url => { :action => "autocomplete" }, :min_chars => 3);
- assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nvar some_input_auto_completer = new Ajax.Autocompleter('some_input', 'some_input_auto_complete', 'http://www.example.com/autocomplete', {onHide:function(element, update){Alert('me');}})\n//]]>\n</script>),
- auto_complete_field("some_input", :url => { :action => "autocomplete" }, :on_hide => "function(element, update){Alert('me');}");
+ assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nvar some_input_auto_completer = new Ajax.Autocompleter('some_input', 'some_input_auto_complete', 'http://www.example.com/autocomplete', {onHide:function(element, update){alert('me');}})\n//]]>\n</script>),
+ auto_complete_field("some_input", :url => { :action => "autocomplete" }, :on_hide => "function(element, update){alert('me');}");
+ assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nvar some_input_auto_completer = new Ajax.Autocompleter('some_input', 'some_input_auto_complete', 'http://www.example.com/autocomplete', {frequency:2})\n//]]>\n</script>),
+ auto_complete_field("some_input", :url => { :action => "autocomplete" }, :frequency => 2);
+ assert_dom_equal %(<script type=\"text/javascript\">\n//<![CDATA[\nvar some_input_auto_completer = new Ajax.Autocompleter('some_input', 'some_input_auto_complete', 'http://www.example.com/autocomplete', {afterUpdateElement:function(element,value){alert('You have chosen: '+value)}})\n//]]>\n</script>),
+ auto_complete_field("some_input", :url => { :action => "autocomplete" },
+ :after_update_element => "function(element,value){alert('You have chosen: '+value)}");
end
def test_auto_complete_result