refactoring jasmine tests