diff options
author | Bob Remeika <bob.remeika@gmail.com> | 2009-11-04 23:18:15 -0800 |
---|---|---|
committer | Stefan Penner <stefan.penner@gmail.com> | 2010-01-27 12:44:31 -0600 |
commit | 7d34975214e80d54786f92cf1daee7ec7847a07c (patch) | |
tree | 7d856210cb7fcf4d14878b170aaaa37094840306 /actionpack/test | |
parent | 39ec7ce6a93945bc97f599d8cb503711a66f3952 (diff) | |
download | rails-7d34975214e80d54786f92cf1daee7ec7847a07c.tar.gz rails-7d34975214e80d54786f92cf1daee7ec7847a07c.tar.bz2 rails-7d34975214e80d54786f92cf1daee7ec7847a07c.zip |
Added submit_to_remote helper
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/javascript/ajax_test.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/javascript/ajax_test.rb b/actionpack/test/javascript/ajax_test.rb index f1207e938d..f4e766d77e 100644 --- a/actionpack/test/javascript/ajax_test.rb +++ b/actionpack/test/javascript/ajax_test.rb @@ -332,7 +332,7 @@ end class ButtonToRemoteTest < AjaxTestCase def button(options, html = {}) - button_to_remote("Remote outpost", options, html) + button_to_remote("RemoteOutpost", options, html) end def url_for(*) @@ -355,6 +355,16 @@ class ButtonToRemoteTest < AjaxTestCase end end +class SubmitToRemoteTest < AjaxTestCase + test "basic" do + expected = %(<input class="fine" type="submit" name="foo" value="bar" data-url="/url/hash" data-js-type="remote" data-update-success=".klass" />) + options = { :url => {:action => "whatnot"}, :update => ".klass", :html => { :class => "fine" } } + + assert_dom_equal expected, + submit_to_remote("foo", "bar", options) + end +end + class ScriptDecoratorTest < AjaxTestCase def decorator() script_decorator("data-js-type" => "foo_type", "data-foo" => "bar", "data-baz" => "bang") |