Skip to content

Instantly share code, notes, and snippets.

@LinuxBozo
Created January 23, 2015 16:37
Show Gist options
  • Save LinuxBozo/ef096825fefc440b2278 to your computer and use it in GitHub Desktop.
Save LinuxBozo/ef096825fefc440b2278 to your computer and use it in GitHub Desktop.
HMDAEngine.isChildFI = function(respondentID) {
var url = HMDAEngine.getAPIURL() + '/isChildFI/' + HMDAEngine.getRuleYear() + '/' + respondentID;
var response = request('GET', url);
var body = JSON.parse(response.getBody('utf8'));
return body.result;
};
describe('isChildFI', function() {
it('should return true when API response result is true', function(done) {
var respondentID = '1';
var path = '/isChildFI/'+engine.getRuleYear()+'/'+respondentID;
var handler = mockAPI.get(path).reply(200, JSON.stringify({ result: true }));
expect(engine.isChildFI(respondentID)).to.be.true();
handler.done();
done();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment