aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngResource
diff options
context:
space:
mode:
authorLeandro Ostera2013-05-14 02:41:01 -0300
committerPete Bacon Darwin2013-07-12 10:47:46 +0100
commitb94ca12fa0b027d8592f5717e038b7b116c59384 (patch)
tree4e0172b8e9e042a793cb835132067d1deea9067c /test/ngResource
parent22a9b1ac07f98d07e1e5d71ce961411b5fa9b42d (diff)
downloadangular.js-b94ca12fa0b027d8592f5717e038b7b116c59384.tar.bz2
feat($resource): support an unescaped URL port
The colon character is used to identify parameters in $resource. This meant that we had to escape the colon used in a port. It turns out that this is not necessary if we assume that parameter names cannot consist of only digits. If the parameter consists only of numbers, then it's a port. Closes #2778
Diffstat (limited to 'test/ngResource')
-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 6a709fb7..52395297 100644
--- a/test/ngResource/resourceSpec.js
+++ b/test/ngResource/resourceSpec.js
@@ -106,6 +106,13 @@ describe("resource", function() {
R.get({a: 'foo', b: 'bar'});
});
+ it('should support an unescaped url', function() {
+ var R = $resource('http://localhost:8080/Path/:a');
+
+ $httpBackend.expect('GET', 'http://localhost:8080/Path/foo').respond();
+ R.get({a: 'foo'});
+ });
+
it('should correctly encode url params', function() {
var R = $resource('/Path/:a');