diff options
| author | Gias Kay Lee | 2013-12-20 23:15:46 +0800 |
|---|---|---|
| committer | Igor Minar | 2014-01-02 23:07:27 -0800 |
| commit | 131e4014b831ac81b7979c4523da81ebc5861c70 (patch) | |
| tree | 8f4e73fb8e3e5e939f930ba956c73dd3fb1997dc /test/ngResource/resourceSpec.js | |
| parent | 01c5be4681e34cdc5f5c461b7a618fefe8038919 (diff) | |
| download | angular.js-131e4014b831ac81b7979c4523da81ebc5861c70.tar.bz2 | |
fix($resource): prevent URL template from collapsing into an empty string
if url template would result in an empty string, we should make a request
to '/' instead.
Closes #5455
Closes #5493
Diffstat (limited to 'test/ngResource/resourceSpec.js')
| -rw-r--r-- | test/ngResource/resourceSpec.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js index 28154313..b23f0ca4 100644 --- a/test/ngResource/resourceSpec.js +++ b/test/ngResource/resourceSpec.js @@ -150,6 +150,13 @@ describe("resource", function() { R.get({a:6, b:7, c:8}); }); + it('should not collapsed the url into an empty string', function() { + var R = $resource('/:foo/:bar/'); + + $httpBackend.when('GET', '/').respond('{}'); + + R.get({}); + }); it('should support escaping colons in url template', function() { var R = $resource('http://localhost\\:8080/Path/:a/\\:stillPath/:b'); |
