Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitm@lovullo.com>2015-05-29 12:45:02 -0400
committerMike Gerwitz <gerwitm@lovullo.com>2015-05-29 12:45:02 -0400
commita383a36bfc59198739d1c4b4c60db8a679f1e1d2 (patch)
treebabce20bc327106292dcaa2f472e86de11e11177 /test
parent0599acc23ac523714d2275d78fa2321e28cab8f5 (diff)
downloadliza-a383a36bfc59198739d1c4b4c60db8a679f1e1d2.tar.gz
liza-a383a36bfc59198739d1c4b4c60db8a679f1e1d2.tar.bz2
liza-a383a36bfc59198739d1c4b4c60db8a679f1e1d2.zip
HttpDataApi#request permits null data
Diffstat (limited to 'test')
-rw-r--r--test/dapi/http/HttpDataApiTest.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/dapi/http/HttpDataApiTest.js b/test/dapi/http/HttpDataApiTest.js
index c1a7dac..a5cdba2 100644
--- a/test/dapi/http/HttpDataApiTest.js
+++ b/test/dapi/http/HttpDataApiTest.js
@@ -175,11 +175,24 @@ describe( 'HttpDataApi', function()
} );
+ it( 'accepts null data, converting to empty string', function()
+ {
+ expect( function()
+ {
+ Sut( dummy_url, 'GET', impl )
+ .request( null, function()
+ {
+ expect( impl.provided[ 2 ] ).to.equal( "" );
+ } );
+ } ).to.not.throw( Error );
+ } );
+
+
it( 'rejects all other data types', function()
{
var sut = Sut( dummy_url, 'GET', impl );
- [ 123, null, Infinity, undefined, NaN, function() {} ]
+ [ 123, Infinity, undefined, NaN, function() {} ]
.forEach( function( data )
{
expect( function()