Groups
Groups
Sign in
Groups
Groups
Angular and AngularJS discussion
Conversations
Labels
About
Send feedback
Help
Unsatisfied requests error on $httpBackend.expectPOST with querystring
1,116 views
Skip to first unread message
Singgih Cahyono
unread,
Jun 19, 2014, 3:33:43 AM
6/19/14
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ang...@googlegroups.com
My jasmine test using
$httpBackend.expectPOST
got "Unsatisfied requests" error.
My $http call is special, because it is a POST with both querystring and content payload also in url param format.
What did I do wrong?
The "/?" in the URL is intentional and not a typho.
$httpBackend.expectPOST('base/?admission/account/index.json',"username=¤tname=&lastname=&firstname=").respond({});
The plunker is here:
http://plnkr.co/edit/ZfjIMIkFgYAjb7ZVbFdd?p=preview
Thank you,
Singgih
Failing 1 spec
1 spec
|
1 failing
Testing MainCtrl should load empty accounts when search params empty.
Error: Unexpected request: [object Object] undefined Expected POST base/?admission/account/index.json
Error: Unexpected request: [object Object] undefined Expected POST base/?admission/account/index.json at $httpBackend (
https://code.angularjs.org/1.2.10/angular-mocks.js:1207:9
) at postForm (
http://run.plnkr.co/9Emw8w2U785nTetP/app.js:19:10
) at Scope.MainCtrl.$scope.loadAccounts (
http://run.plnkr.co/9Emw8w2U785nTetP/app.js:7:3
) at null.<anonymous> (
http://run.plnkr.co/9Emw8w2U785nTetP/appSpec.js:35:16
) at jasmine.Block.execute (
http://cdn.jsdelivr.net/jasmine/1.3.1/jasmine.js:1064:17
) at jasmine.Queue.next_ (
http://cdn.jsdelivr.net/jasmine/1.3.1/jasmine.js:2096:31
) at
http://cdn.jsdelivr.net/jasmine/1.3.1/jasmine.js:2086:18
Error: Unsatisfied requests: POST base/?admission/account/index.json
Error: Unsatisfied requests: POST base/?admission/account/index.json at Function.$httpBackend.verifyNoOutstandingExpectation (
https://code.angularjs.org/1.2.10/angular-mocks.js:1516:13
) at null.<anonymous> (
http://run.plnkr.co/9Emw8w2U785nTetP/appSpec.js:27:22
) at jasmine.Block.execute (
http://cdn.jsdelivr.net/jasmine/1.3.1/jasmine.js:1064:17
) at jasmine.Queue.next_ (
http://cdn.jsdelivr.net/jasmine/1.3.1/jasmine.js:2096:31
) at
http://cdn.jsdelivr.net/jasmine/1.3.1/jasmine.js:2086:18
Reply all
Reply to author
Forward
0 new messages