aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorIgor Minar2011-02-10 17:57:42 -0800
committerIgor Minar2011-02-10 17:57:42 -0800
commite9ce22592aaf36ce57c4eaa6202842d9f383d172 (patch)
treebf5b88c77e2bc9cec11ed29894615a58caa1922a /test
parent4f6fe1d479e91842d0e679d46b6acfff85459af4 (diff)
downloadangular.js-e9ce22592aaf36ce57c4eaa6202842d9f383d172.tar.bz2
$resource should encode url params with encodeURIComponent
Diffstat (limited to 'test')
-rw-r--r--test/ResourceSpec.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js
index 8b78df12..d61282ea 100644
--- a/test/ResourceSpec.js
+++ b/test/ResourceSpec.js
@@ -40,6 +40,14 @@ describe("resource", function() {
R.get({a:4, b:5, c:6});
});
+ it('should correctly encode url params', function(){
+ var R = resource.route('/Path/:a');
+ xhr.expectGET('/Path/foo%231').respond({});
+ xhr.expectGET('/Path/doh!%40foo?bar=baz%231').respond({});
+ R.get({a: 'foo#1'});
+ R.get({a: 'doh!@foo', bar: 'baz#1'});
+ });
+
it("should build resource with default param", function(){
xhr.expectGET('/Order/123/Line/456.visa?minimum=0.05').respond({id:'abc'});
var LineItem = resource.route('/Order/:orderId/Line/:id:verb', {orderId: '123', id: '@id.key', verb:'.visa', minimum:0.05});