The late answer, which I know, but I asked myself this and could not find a definite answer. The returned object has the configuration property, which has the properties baseUrl and restangularFields.
I would also suggest moving the custom Restangular object to my own service:
angular.module('myServices') .factory('TestService', ['Restangular', function(restangular) { return restangular.withConfig(function(RestangularConfigurer) { RestangularConfigurer.setBaseUrl('api'); RestangularConfigurer.setRestangularFields({ id: 'Id'}); }); } ]) .factory('Job', ['TestService', function (TestService) { return TestService.all('Job'); } ]);
So you can test like this:
//sut is 'system under test', in your case the TestService expect(sut.configuration.baseUrl).toEqual('api'); expect(sut.configuration.restangularFields.id).toEqual('id');
pseudological
source share