Angular resource testing: $httpBackend.flush() cause Unexpected request
I want to test angularjs resource. 'use strict'; /** * AddressService provides functionality to use address resource in easy way. * * This is an example usage of method: * * `get`: * var a = AddressService.get({id: '1'}, function (data) { // Work here with your resource } ); * */ App.factory('AddressService', function ($resource, $rootScope) { var url = [ $rootScope.GLOBALS.API_PATH, $rootScope.GLOBALS.API_VERSION, 'models/address/:id' ].join('/'), actions = { 'get': { method: 'GET', params: {id: '@id'} } }; return $resource(url, {}, actions); }); I created the test: 'use strict'; var