Update and refactor jasmine test.