diff options
| author | Ryan Schumacher | 2013-04-03 10:40:16 -0500 |
|---|---|---|
| committer | Igor Minar | 2013-05-16 14:26:08 -0700 |
| commit | cefbcd470d4c9020cc3487b2326d45058ef831e2 (patch) | |
| tree | aafaaf17f9b3d1743e897f8dc2a3e07de6c658d0 /test/ngResource/resourceSpec.js | |
| parent | f9b897de4b5cc438515cbb54519fbdf6242f5858 (diff) | |
| download | angular.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.js | 10 |
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'); |
