Skip to Content
SAP Gateway

OData acceptance tests with QUnit and datajs

Tags:

Quickly create Acceptance Test for OData Services

var request = {

  resourcePath: "CarrierCollection('LH')",

  headers: {Accept: "application/atom+xml"}

};

odataTest("Lufthansa", 3, request, function (response, data) {

  equal(response.statusCode, 200, "StatusCode: 200");

  expectedHeaders(response.headers,

    { "Content-Type" : "application/atom+xml" }, "Content-Type: application/atom+xml" );

  equal(data.AirLineName, "Lufthansa", "AirLineName: Lufthansa");

});


  • Run the test

   

  
Qunit-OData addon

The source code of the qunit addon is available on github.