Test Ajax

Elvenware Logo

TOC

Overview

This page is currently broken and under construction

Using QUnit

Using QUnit

{#qunit-banner}

{#qunit-userAgent}

test('readJson', function() {

    $.ajax = function(options) {
          equal(options.url, "MyData.json");
          options.success( { "Result": "Success" } );
      };

    var app = new App();
    app.readJsonTest(function(data) {
        equal(data.Result, 'Success');
        //start();
    }, function(request, ajaxOptions, thrownError) {
        ok(false, 'call to readJson failed: ' + request.responseText);
        //start();
    });
});