On Tue, Jun 19, 2012 at 2:37 PM, Greg Bacon <greg.ba
...@gmail.com> wrote:
> [Also asked on Stack Overflow <
http://stackoverflow.com/q/11109397/123109>,
> where almost 30% of the Jasmine questions are unanswered.]
> I’m trying to debug a spy on jQuery.post<http://api.jquery.com/jQuery.post/>that isn’t firing, so as a sanity check, I tried
> spyOn(this.viewModel.requests, 'submitRequest').andReturn('fooz');
> var ret = this.viewModel.requests.submitRequest();
> expect(ret).toEqual('foo');
> expect(this.viewModel.requests.submitRequest).toHaveBeenCalled();
> This fails with
> Expected 'fooz' to equal 'foo'.
> But when I change 'fooz' to 'foo' in the argument to andReturn, the test
> fails with
> Expected spy on submitRequest to have been called.
> The spy is returning the canned value, so why does toHaveBeenCalled fail?
> Thanks,
> Greg
> --
> You received this message because you are subscribed to the Google Groups
> "Jasmine" group.
> To post to this group, send email to jasmine-js@googlegroups.com.
> To unsubscribe from this group, send email to
> jasmine-js+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/jasmine-js?hl=en.