aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngResource/resourceSpec.js
diff options
context:
space:
mode:
authorRyan Schumacher2013-04-03 10:40:16 -0500
committerIgor Minar2013-05-16 14:26:08 -0700
commitcefbcd470d4c9020cc3487b2326d45058ef831e2 (patch)
treeaafaaf17f9b3d1743e897f8dc2a3e07de6c658d0 /test/ngResource/resourceSpec.js
parentf9b897de4b5cc438515cbb54519fbdf6242f5858 (diff)
downloadangular.js-cefbcd470d4c9020cc3487b2326d45058ef831e2.tar.bz2
fix($resource): null default param results in TypeError
Fixes issue when setting a default param as `null` error `TypeError: Cannot read property 'charAt' of null`
Diffstat (limited to 'test/ngResource/resourceSpec.js')
-rw-r--r--test/ngResource/resourceSpec.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js
index 916fa455..ec7f1476 100644
--- a/test/ngResource/resourceSpec.js
+++ b/test/ngResource/resourceSpec.js
@@ -205,6 +205,16 @@ describe("resource", function() {
});
+ it('should not throw TypeError on null default params', function() {
+ $httpBackend.expect('GET', '/Path?').respond('{}');
+ var R = $resource('/Path', {param: null}, {get: {method: 'GET'}});
+
+ expect(function() {
+ R.get({});
+ }).not.toThrow();
+ });
+
+
it('should handle multiple params with same name', function() {
var R = $resource('/:id/:id');