@@ -42,11 +42,6 @@ const fullTextHelper = () => {
4242 restAPIKey : 'test' ,
4343 publicServerURL : 'http://localhost:8378/1' ,
4444 databaseAdapter
45- } ) . then ( ( ) => {
46- if ( process . env . PARSE_SERVER_TEST_DB === 'postgres' ) {
47- return Parse . Promise . as ( ) ;
48- }
49- return databaseAdapter . createIndex ( 'TestObject' , { subject : 'text' } ) ;
5045 } ) . then ( ( ) => {
5146 return rp . post ( {
5247 url : 'http://localhost:8378/1/batch' ,
@@ -285,7 +280,7 @@ describe('Parse.Query Full Text Search testing', () => {
285280} ) ;
286281
287282describe_only_db ( 'mongo' ) ( 'Parse.Query Full Text Search testing' , ( ) => {
288- it ( 'fullTextSearch: $search, index not exist ' , ( done ) => {
283+ it ( 'fullTextSearch: $search, only one text index ' , ( done ) => {
289284 return reconfigureServer ( {
290285 appId : 'test' ,
291286 restAPIKey : 'test' ,
@@ -318,6 +313,8 @@ describe_only_db('mongo')('Parse.Query Full Text Search testing', () => {
318313 'X-Parse-REST-API-Key' : 'test'
319314 }
320315 } ) ;
316+ } ) . then ( ( ) => {
317+ return databaseAdapter . createIndex ( 'TestObject' , { random : 'text' } ) ;
321318 } ) . then ( ( ) => {
322319 const where = {
323320 subject : {
@@ -337,7 +334,7 @@ describe_only_db('mongo')('Parse.Query Full Text Search testing', () => {
337334 }
338335 } ) ;
339336 } ) . then ( ( resp ) => {
340- fail ( `Text Index should not exist : ${ JSON . stringify ( resp ) } ` ) ;
337+ fail ( `Should not be more than one text index : ${ JSON . stringify ( resp ) } ` ) ;
341338 done ( ) ;
342339 } ) . catch ( ( err ) => {
343340 expect ( err . error . code ) . toEqual ( Parse . Error . INTERNAL_SERVER_ERROR ) ;
0 commit comments