Bug Tracker

Changeset 5702

Show
Ignore:
Timestamp:
05/27/08 22:46:28 (6 months ago)
Author:
aflesler
Message:

test runner: a test for load() with a hash of data, and another for load() with a string of data (#1516).
It includes a php that dumps all the GET and POST vars to html elements, where the key makes the id, and the value the text.

Location:
trunk/jquery/test
Files:
1 added
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/test/unit/ajax.js

    r5483 r5702  
    386386}); 
    387387 
     388test("load(String, Object, Function)", function() { 
     389    expect(2); 
     390    stop(); 
     391     
     392    $('<div />').load(url('data/params_html.php'), { foo:3, bar:'ok' }, function() { 
     393        var $post = $(this).find('#post');       
     394        equals( $post.find('#foo').text(), '3', 'Check if a hash of data is passed correctly'); 
     395        equals( $post.find('#bar').text(), 'ok', 'Check if a hash of data is passed correctly'); 
     396        start(); 
     397    }); 
     398}); 
     399 
     400test("load(String, String, Function)", function() { 
     401    expect(2); 
     402    stop(); 
     403     
     404    $('<div />').load(url('data/params_html.php'), 'foo=3&bar=ok', function() { 
     405        var $get = $(this).find('#get');         
     406        equals( $get.find('#foo').text(), '3', 'Check if a string of data is passed correctly'); 
     407        equals( $get.find('#bar').text(), 'ok', 'Check if a  of data is passed correctly'); 
     408        start(); 
     409    }); 
     410}); 
     411 
    388412test("$.get(String, Hash, Function) - parse xml and use text() on nodes", function() { 
    389413    expect(2);