better use of jasmine spies