Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$httpBackend.expectPost is not matching my $http post request (jasmine unit test) #2945

Closed
mattymess opened this issue Jun 12, 2013 · 1 comment

Comments

@mattymess
Copy link

I've got an assertion that mocks a post request to my controller, which I've setup to respond with a success code of 200. However, my success function is never called in the controller, nor is the error function.

In my assertion, I'm testing a property on scope that gets set in the success function. Since it never gets called, my assertion always fails.

CONTROLLER

$http.post('/videos/comment', {
  comment: 'test' 
})
.success($scope.commentSuccess)
.error($scope.commentError)

SPEC

_$httpBackend.expectPOST('/videos'/comment', {
  comment: 'test'
}).respond(200)
@btford btford closed this as completed Aug 24, 2013
@btford
Copy link
Contributor

btford commented Aug 24, 2013

As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.

Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.

Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants