Skip to content

Commit

Permalink
Move setting headers to occur for all document requests including GET.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fredrick Whorton committed May 6, 2015
1 parent 7643587 commit 0470ad3
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions test/v1_0_2/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
(function (process, request, should, helper, qs, validUrl) {
'use strict';

var LRS_ENDPOINT = process.env.LRS_ENDPOINT || 'http://asdf.elmnts-test.com:8001/lrs';
var request = request(LRS_ENDPOINT);
var request = request(helper.getEndpoint());

/**
* Sends an HTTP request using supertest
Expand All @@ -26,10 +25,10 @@
var headers = helper.addAllHeaders({});
var pre = request[type](reqUrl);
if (body) {
pre.send(body)
.set('X-Experience-API-Version', headers['X-Experience-API-Version'])
.set('Authorization', headers['Authorization']);
pre.send(body);
}
pre.set('X-Experience-API-Version', headers['X-Experience-API-Version'])
.set('Authorization', headers['Authorization']);
return pre.expect(expect);
}

Expand Down Expand Up @@ -58,14 +57,7 @@
var parameters = {
objectType: 'Person'
};

request
.get('/agents?' + qs.stringify(parameters))
.set('X-Experience-API-Version', '1.0.1')
.send({})
.expect(200, function (err, res) {
done();
});
return sendRequest('get', '/agents', parameters, undefined, 200);
});

it('An LRS has an Agent Profile API with endpoint "base IRI"+"/agents/profile" (7.3.table1.row3.a, 7.3.table1.row3.c)', function () {
Expand Down

0 comments on commit 0470ad3

Please sign in to comment.