X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=1e1e8123a9dfe429ed3e7cbf2562ac15e068a92b;hb=3dabd7ec301770a2a6bb8457c96d630d42376719;hp=872ec08899a3c730a5fdfa0adfd8f1bfa3587088;hpb=6728e3cf74d02794113deb0af70a5f9a7caa2241;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index 872ec08..1e1e812 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -166,11 +166,11 @@ test("serialize()", function() { expect(6); equals( $('#form').serialize(), - "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&select1=&select2=3&select3=0&select3=1", + "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&select1=&select2=3&select3=1&select3=2", 'Check form serialization as query string'); equals( $('#form :input').serialize(), - "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&select1=&select2=3&select3=0&select3=1", + "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&select1=&select2=3&select3=1&select3=2", 'Check input serialization as query string'); equals( $('#testForm').serialize(), @@ -182,11 +182,11 @@ test("serialize()", function() { 'Check input serialization as query string'); equals( $('#form, #testForm').serialize(), - "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&select1=&select2=3&select3=0&select3=1&T3=%3F%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=", + "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&select1=&select2=3&select3=1&select3=2&T3=%3F%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=", 'Multiple form serialization as query string'); equals( $('#form, #testForm :input').serialize(), - "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&select1=&select2=3&select3=0&select3=1&T3=%3F%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=", + "action=Test&radio2=on&check=on&hidden=&foo%5Bbar%5D=&name=name&select1=&select2=3&select3=1&select3=2&T3=%3F%0AZ&H1=x&H2=&PWD=&T1=&T2=YES&My+Name=me&S1=abc&S3=YES&S4=", 'Mixed form/input serialization as query string'); }); @@ -516,13 +516,20 @@ test("$.getJSON(String, Function) - JSON object", function() { }); test("$.post(String, Hash, Function) - simple with xml", function() { - expect(2); + expect(4); stop(); $.post(url("data/name.php"), {xml: "5-2"}, function(xml){ $('math', xml).each(function() { ok( $('calculation', this).text() == '5-2', 'Check for XML' ); ok( $('result', this).text() == '3', 'Check for XML' ); }); + }); + + $.post(url("data/name.php?xml=5-2"), {}, function(xml){ + $('math', xml).each(function() { + ok( $('calculation', this).text() == '5-2', 'Check for XML' ); + ok( $('result', this).text() == '3', 'Check for XML' ); + }); start(); }); });