aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngResource/resourceSpec.js
diff options
context:
space:
mode:
authorGias Kay Lee2013-12-20 23:15:46 +0800
committerIgor Minar2014-01-02 23:07:27 -0800
commit131e4014b831ac81b7979c4523da81ebc5861c70 (patch)
tree8f4e73fb8e3e5e939f930ba956c73dd3fb1997dc /test/ngResource/resourceSpec.js
parent01c5be4681e34cdc5f5c461b7a618fefe8038919 (diff)
downloadangular.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.js7
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');