aboutsummaryrefslogtreecommitdiffstats
path: root/test/ngResource/resourceSpec.js
diff options
context:
space:
mode:
authorAndrew McLeod2013-02-25 21:25:18 -0800
committerIgor Minar2013-02-26 17:25:15 -0800
commit86d191ed4aea9015adc71b852223475c5c762c34 (patch)
tree2d07565c9be92371890595c5dcce5071cef9d53f /test/ngResource/resourceSpec.js
parentc38c1c503074af1b0aae7498b9381cb90cd63958 (diff)
downloadangular.js-86d191ed4aea9015adc71b852223475c5c762c34.tar.bz2
fix($http): don't encode URL query substring "null" to "+"
Fixes issue in encodeUriQuery used by $http and $resource that treats null as a string and replaces the characters "null" with "+".
Diffstat (limited to 'test/ngResource/resourceSpec.js')
-rw-r--r--test/ngResource/resourceSpec.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/ngResource/resourceSpec.js b/test/ngResource/resourceSpec.js
index 3f2df284..e5366f4f 100644
--- a/test/ngResource/resourceSpec.js
+++ b/test/ngResource/resourceSpec.js
@@ -136,6 +136,12 @@ describe("resource", function() {
R.get({a: 'doh&foo', bar: ['baz1', 'baz2']});
});
+ it('should not encode string "null" to "+" in url params', function() {
+ var R = $resource('/Path/:a');
+ $httpBackend.expect('GET', '/Path/null').respond('{}');
+ R.get({a: 'null'});
+ });
+
it('should allow relative paths in resource url', function () {
var R = $resource(':relativePath');
$httpBackend.expect('GET', 'data.json').respond('{}');