0
def test_link_to_remote
0
- assert_equal %(<a class=\"fine\" href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {
evalScripts:true, asynchronous:true}); return false;\">Remote outpost</a>),
0
+ assert_equal %(<a class=\"fine\" href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {
asynchronous:true, evalScripts:true}); return false;\">Remote outpost</a>),
0
link_to_remote("Remote outpost", { :url => { :action => "whatnot" }}, { :class => "fine" })
0
- assert_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {
onComplete:function(request){alert(request.reponseText)}, evalScripts:true, asynchronous:true}); return false;\">Remote outpost</a>),
0
+ assert_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {
asynchronous:true, evalScripts:true, onComplete:function(request){alert(request.reponseText)}}); return false;\">Remote outpost</a>),
0
link_to_remote("Remote outpost", :complete => "alert(request.reponseText)", :url => { :action => "whatnot" })
0
def test_periodically_call_remote
0
- assert_equal %(<script>new PeriodicalExecuter(function() {new Ajax.Updater('schremser_bier', 'http://www.example.com/mehr_bier', {
evalScripts:true, asynchronous:true})}, 10)</script>),
0
+ assert_equal %(<script>new PeriodicalExecuter(function() {new Ajax.Updater('schremser_bier', 'http://www.example.com/mehr_bier', {
asynchronous:true, evalScripts:true})}, 10)</script>),
0
periodically_call_remote(:update => "schremser_bier", :url => { :action => "mehr_bier" })
0
def test_form_remote_tag
0
- assert_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater('glass_of_beer', 'http://www.example.com/fast', {
parameters:Form.serialize(this), evalScripts:true, asynchronous:true}); return false;\">),
0
+ assert_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;\">),
0
form_remote_tag(:update => "glass_of_beer", :url => { :action => :fast })
0
- assert_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater({success:'glass_of_beer'}, 'http://www.example.com/fast', {
parameters:Form.serialize(this), evalScripts:true, asynchronous:true}); return false;\">),
0
+ assert_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater({success:'glass_of_beer'}, 'http://www.example.com/fast', {
asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">),
0
form_remote_tag(:update => { :success => "glass_of_beer" }, :url => { :action => :fast })
0
- assert_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater({failure:'glass_of_water'}, 'http://www.example.com/fast', {
parameters:Form.serialize(this), evalScripts:true, asynchronous:true}); return false;\">),
0
+ assert_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater({failure:'glass_of_water'}, 'http://www.example.com/fast', {
asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">),
0
form_remote_tag(:update => { :failure => "glass_of_water" }, :url => { :action => :fast })
0
- assert_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater({success:'glass_of_beer',failure:'glass_of_water'}, 'http://www.example.com/fast', {
parameters:Form.serialize(this), evalScripts:true, asynchronous:true}); return false;\">),
0
+ assert_equal %(<form action=\"http://www.example.com/fast\" method=\"post\" onsubmit=\"new Ajax.Updater({success:'glass_of_beer',failure:'glass_of_water'}, 'http://www.example.com/fast', {
asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">),
0
form_remote_tag(:update => { :success => 'glass_of_beer', :failure => "glass_of_water" }, :url => { :action => :fast })
0
def test_submit_to_remote
0
- assert_equal %(<input name=\"More beer!\" onclick=\"new Ajax.Updater('empty_bottle', 'http://www.example.com/', {
parameters:Form.serialize(this.form), evalScripts:true, asynchronous:true}); return false;\" type=\"button\" value=\"1000000\" />),
0
+ assert_equal %(<input name=\"More beer!\" onclick=\"new Ajax.Updater('empty_bottle', 'http://www.example.com/', {
asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form)}); return false;\" type=\"button\" value=\"1000000\" />),
0
submit_to_remote("More beer!", 1_000_000, :update => "empty_bottle")
0
- assert_equal %(<script type=\"text/javascript\">new Form.Element.Observer('glass', 300, function(element, value) {new Ajax.Request('http://www.example.com/reorder_if_empty', {
evalScripts:true, asynchronous:true})})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">new Form.Element.Observer('glass', 300, function(element, value) {new Ajax.Request('http://www.example.com/reorder_if_empty', {
asynchronous:true, evalScripts:true})})</script>),
0
observe_field("glass", :frequency => 5.minutes, :url => { :action => "reorder_if_empty" })
0
- assert_equal %(<script type=\"text/javascript\">new Form.Observer('cart', 2, function(element, value) {new Ajax.Request('http://www.example.com/cart_changed', {
evalScripts:true, asynchronous:true})})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">new Form.Observer('cart', 2, function(element, value) {new Ajax.Request('http://www.example.com/cart_changed', {
asynchronous:true, evalScripts:true})})</script>),
0
observe_form("cart", :frequency => 2, :url => { :action => "cart_changed" })
0
def test_sortable_element
0
- assert_equal %(<script type=\"text/javascript\">Sortable.create('mylist', {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {
parameters:Sortable.serialize('mylist'), evalScripts:true, asynchronous:true})}})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">Sortable.create('mylist', {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {
asynchronous:true, evalScripts:true, parameters:Sortable.serialize('mylist')})}})</script>),
0
sortable_element("mylist", :url => { :action => "order" })
0
- assert_equal %(<script type=\"text/javascript\">Sortable.create('mylist', {
tag:'div', constraint:'horizontal', onUpdate:function(){new Ajax.Request('http://www.example.com/order', {parameters:Sortable.serialize('mylist'), evalScripts:true, asynchronous:true})}})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">Sortable.create('mylist', {
constraint:'horizontal', onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize('mylist')})}, tag:'div'})</script>),
0
sortable_element("mylist", :tag => "div", :constraint => "horizontal", :url => { :action => "order" })
0
- assert_equal %|<script type=\"text/javascript\">Sortable.create('mylist', {constraint:'horizontal',
onUpdate:function(){new Ajax.Request('http://www.example.com/order', {parameters:Sortable.serialize('mylist'), evalScripts:true, asynchronous:true})}, containment:['list1','list2']})</script>|,
0
+ assert_equal %|<script type=\"text/javascript\">Sortable.create('mylist', {constraint:'horizontal',
containment:['list1','list2'], onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize('mylist')})}})</script>|,
0
sortable_element("mylist", :containment => ['list1','list2'], :constraint => "horizontal", :url => { :action => "order" })
0
- assert_equal %(<script type=\"text/javascript\">Sortable.create('mylist', {constraint:'horizontal',
onUpdate:function(){new Ajax.Request('http://www.example.com/order', {parameters:Sortable.serialize('mylist'), evalScripts:true, asynchronous:true})}, containment:'list1'})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">Sortable.create('mylist', {constraint:'horizontal',
containment:'list1', onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize('mylist')})}})</script>),
0
sortable_element("mylist", :containment => 'list1', :constraint => "horizontal", :url => { :action => "order" })
0
def test_drop_receiving_element
0
- assert_equal %(<script type=\"text/javascript\">Droppables.add('droptarget1', {onDrop:function(element){new Ajax.Request('http://www.example.com/', {
parameters:'id=' + encodeURIComponent(element.id), evalScripts:true, asynchronous:true})}})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">Droppables.add('droptarget1', {onDrop:function(element){new Ajax.Request('http://www.example.com/', {
asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}})</script>),
0
drop_receiving_element('droptarget1')
0
- assert_equal %(<script type=\"text/javascript\">Droppables.add('droptarget1', {accept:'products', onDrop:function(element){new Ajax.Request('http://www.example.com/', {
parameters:'id=' + encodeURIComponent(element.id), evalScripts:true, asynchronous:true})}})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">Droppables.add('droptarget1', {accept:'products', onDrop:function(element){new Ajax.Request('http://www.example.com/', {
asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}})</script>),
0
drop_receiving_element('droptarget1', :accept => 'products')
0
- assert_equal %(<script type=\"text/javascript\">Droppables.add('droptarget1', {accept:'products', onDrop:function(element){new Ajax.Updater('infobox', 'http://www.example.com/', {
parameters:'id=' + encodeURIComponent(element.id), evalScripts:true, asynchronous:true})}})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">Droppables.add('droptarget1', {accept:'products', onDrop:function(element){new Ajax.Updater('infobox', 'http://www.example.com/', {
asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}})</script>),
0
drop_receiving_element('droptarget1', :accept => 'products', :update => 'infobox')
0
- assert_equal %(<script type=\"text/javascript\">Droppables.add('droptarget1', {accept:['tshirts','mugs'], onDrop:function(element){new Ajax.Updater('infobox', 'http://www.example.com/', {
parameters:'id=' + encodeURIComponent(element.id), evalScripts:true, asynchronous:true})}})</script>),
0
+ assert_equal %(<script type=\"text/javascript\">Droppables.add('droptarget1', {accept:['tshirts','mugs'], onDrop:function(element){new Ajax.Updater('infobox', 'http://www.example.com/', {
asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}})</script>),
0
drop_receiving_element('droptarget1', :accept => ['tshirts','mugs'], :update => 'infobox')
Comments
No one has commented yet.