Asynchronous Jasmine test bug fix

Fix contributed by @stevesouth for fixing asynchronous Jasmine tests. This fix does not have any tests associated with it as none were provided, but is useful none the less.

<!---
@huboard:{"order":1023.0,"milestone_order":1047,"custom_state":""}
-->