X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=test%2Funit%2Fajax.js;h=9514a8edc4a818459af1d4755efac3b389d8beb5;hb=c6e88b16e9f6e45d87019db45dd04d27482d25d7;hp=fc2ab9e3367e60442b16b4b202cb607dbf5d7f44;hpb=7ec772374d132149d72418abce4569dedbd4168b;p=jquery.git diff --git a/test/unit/ajax.js b/test/unit/ajax.js index fc2ab9e..9514a8e 100644 --- a/test/unit/ajax.js +++ b/test/unit/ajax.js @@ -385,6 +385,30 @@ test("load(String, Function) - check file with only a script tag", function() { }); }); +test("load(String, Object, Function)", function() { + expect(2); + stop(); + + $('
').load(url('data/params_html.php'), { foo:3, bar:'ok' }, function() { + var $post = $(this).find('#post'); + equals( $post.find('#foo').text(), '3', 'Check if a hash of data is passed correctly'); + equals( $post.find('#bar').text(), 'ok', 'Check if a hash of data is passed correctly'); + start(); + }); +}); + +test("load(String, String, Function)", function() { + expect(2); + stop(); + + $('
').load(url('data/params_html.php'), 'foo=3&bar=ok', function() { + var $get = $(this).find('#get'); + equals( $get.find('#foo').text(), '3', 'Check if a string of data is passed correctly'); + equals( $get.find('#bar').text(), 'ok', 'Check if a of data is passed correctly'); + start(); + }); +}); + test("$.get(String, Hash, Function) - parse xml and use text() on nodes", function() { expect(2); stop();