We are having a problem with Protractor/Jasmine. The 'response' variable below only has context in the closure of the client.post {} call. The problem is checking the expect condition within the client.post {} call also looses scope and is not reported in the protractor results. How would you test the correct response code is returned without loosing context?

describe('Verify Basic REST Calls', function() {

it('Call the Custom Rest interface ', function () {
client.get(baseURL + '/custom', args, function (data, response) {