File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -440,8 +440,8 @@ Datastore.NO_MORE_RESULTS = 'NO_MORE_RESULTS';
440440 * var query = datastore.createQuery('Company');
441441 */
442442Datastore . prototype . createQuery = function ( namespace , kind ) {
443- if ( arguments . length === 1 ) {
444- kind = arrify ( namespace ) ;
443+ if ( arguments . length < 2 ) {
444+ kind = namespace ;
445445 namespace = this . namespace ;
446446 }
447447
Original file line number Diff line number Diff line change @@ -284,6 +284,14 @@ describe('Datastore', function() {
284284 assert . strictEqual ( query . calledWith_ [ 1 ] , datastore . namespace ) ;
285285 assert . deepEqual ( query . calledWith_ [ 2 ] , kind ) ;
286286 } ) ;
287+
288+ it ( 'should include the default namespace in a kindless query' , function ( ) {
289+ var query = datastore . createQuery ( ) ;
290+
291+ assert . strictEqual ( query . calledWith_ [ 0 ] , datastore ) ;
292+ assert . strictEqual ( query . calledWith_ [ 1 ] , datastore . namespace ) ;
293+ assert . deepEqual ( query . calledWith_ [ 2 ] , [ ] ) ;
294+ } ) ;
287295 } ) ;
288296
289297 describe ( 'key' , function ( ) {
You can’t perform that action at this time.
0 commit comments