Jasmine tests for refactored code