A javascript Jasmine test using a spy to verify behavior (from the demo)