Created
January 23, 2015 16:37
-
-
Save LinuxBozo/ef096825fefc440b2278 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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