diff --git a/src/ngResource/resource.js b/src/ngResource/resource.js index 46642157db20..07a11c49fcdc 100644 --- a/src/ngResource/resource.js +++ b/src/ngResource/resource.js @@ -568,10 +568,17 @@ angular.module('ngResource', ['ng']). undefined; forEach(action, function(value, key) { - if (key != 'params' && key != 'isArray' && key != 'interceptor' && key != 'timeout') { - httpConfig[key] = copy(value); - } else if (key == 'timeout') { - httpConfig[key] = value; + switch (key) { + default: + httpConfig[key] = copy(value); + break; + case 'params': + case 'isArray': + case 'interceptor': + break; + case 'timeout': + httpConfig[key] = value; + break; } }); diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index b19bb53ddd0f..a8edc58eedd7 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -1357,7 +1357,7 @@ describe('resource', function() { ); }); - it('If timeout promise is resolved, cancel the request', function() { + it('should cancel the request if timeout promise is resolved', function() { var canceler = $q.defer(); $httpBackend.when('GET', '/CreditCard').respond({data: '123'});