diff options
| author | Igor Minar | 2011-03-18 10:31:28 -0700 | 
|---|---|---|
| committer | Igor Minar | 2011-03-28 23:33:46 -0700 | 
| commit | e1d122a4b7ba837997cd258939daf82310adc223 (patch) | |
| tree | d2c60952292e83069930b54c188c7efd7bdcfcb9 /test/ResourceSpec.js | |
| parent | 885c3ad5ddc5016d6ef1b87d050f2c9bc23136b2 (diff) | |
| download | angular.js-e1d122a4b7ba837997cd258939daf82310adc223.tar.bz2 | |
encode $resource query params using encodeURIComponent
Diffstat (limited to 'test/ResourceSpec.js')
| -rw-r--r-- | test/ResourceSpec.js | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/test/ResourceSpec.js b/test/ResourceSpec.js index 2c084ec1..633fd605 100644 --- a/test/ResourceSpec.js +++ b/test/ResourceSpec.js @@ -55,10 +55,16 @@ describe("resource", function() {      //buzz api which uses @self      var R = resource.route('/Path/:a'); -    xhr.expectGET('/Path/doh@foo?bar=baz@1').respond({}); +    xhr.expectGET('/Path/doh@foo?bar=baz%401').respond({});      R.get({a: 'doh@foo', bar: 'baz@1'});    }); +  it('should encode & in url params', function() { +    var R = resource.route('/Path/:a'); +    xhr.expectGET('/Path/doh&foo?bar=baz%261').respond({}); +    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}); | 
