From 131e4014b831ac81b7979c4523da81ebc5861c70 Mon Sep 17 00:00:00 2001 From: Gias Kay Lee Date: Fri, 20 Dec 2013 23:15:46 +0800 Subject: 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 --- test/ngResource/resourceSpec.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/ngResource/resourceSpec.js') 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'); -- cgit v1.2.3