Pubstwo 1023

Another way to do this that may be clearer is to use create a spy for the success and a spy for the error functions and test whether they have been called or not.