@@ -29,7 +29,7 @@ def loop_times(times)
2929 { id : 'frodo-baggins' , name : 'Frodo Baggins' , race : 'Hobbit' , age : 50 } ,
3030 { id : 'sam-gamgee' , name : 'Samwise Gamgee' , race : 'Hobbit' , age : 38 } ,
3131 { id : 'gandalf' , name : 'Gandalf the Grey' , race : 'Istari' } ,
32- { id : 'legolas ' , name : 'Legolas ' , race : 'Elf' , age : 500 }
32+ { id : 'legoblast ' , name : 'Legoblast ' , race : 'Elf' , age : 500 }
3333 ]
3434 @client . upsert_users ( @fellowship_of_the_ring )
3535 @channel = @client . channel ( 'team' , channel_id : 'fellowship-of-the-ring' ,
@@ -381,7 +381,7 @@ def loop_times(times)
381381 end
382382
383383 it 'queries channels' do
384- response = @client . query_channels ( { 'members' => { '$in' => [ 'legolas ' ] } } , sort : { 'id' => 1 } )
384+ response = @client . query_channels ( { 'members' => { '$in' => [ 'legoblast ' ] } } , sort : { 'id' => 1 } )
385385 expect ( response [ 'channels' ] . length ) . to eq 1
386386 expect ( response [ 'channels' ] [ 0 ] [ 'channel' ] [ 'id' ] ) . to eq 'fellowship-of-the-ring'
387387 expect ( response [ 'channels' ] [ 0 ] [ 'members' ] . length ) . to eq 4
@@ -440,41 +440,41 @@ def loop_times(times)
440440 describe 'search' do
441441 it 'search for messages' do
442442 text = SecureRandom . uuid
443- @channel . send_message ( { text : text } , 'legolas ' )
444- resp = @client . search ( { members : { '$in' => [ 'legolas ' ] } } , text )
443+ @channel . send_message ( { text : text } , 'legoblast ' )
444+ resp = @client . search ( { members : { '$in' => [ 'legoblast ' ] } } , text )
445445 p resp
446446 expect ( resp [ 'results' ] . length ) . to eq ( 1 )
447447 end
448448
449449 it 'search for messages with filter conditions' do
450450 text = SecureRandom . uuid
451- @channel . send_message ( { text : text } , 'legolas ' )
452- resp = @client . search ( { members : { '$in' => [ 'legolas ' ] } } , { text : { '$q' : text } } )
451+ @channel . send_message ( { text : text } , 'legoblast ' )
452+ resp = @client . search ( { members : { '$in' => [ 'legoblast ' ] } } , { text : { '$q' : text } } )
453453 expect ( resp [ 'results' ] . length ) . to eq ( 1 )
454454 end
455455
456456 it 'offset with sort should fail' do
457457 expect do
458- @client . search ( { members : { '$in' => [ 'legolas ' ] } } , SecureRandom . uuid , sort : { created_at : -1 } , offset : 2 )
458+ @client . search ( { members : { '$in' => [ 'legoblast ' ] } } , SecureRandom . uuid , sort : { created_at : -1 } , offset : 2 )
459459 end . to raise_error ( /cannot use offset with next or sort parameters/ )
460460 end
461461
462462 it 'offset with next should fail' do
463463 expect do
464- @client . search ( { members : { '$in' => [ 'legolas ' ] } } , SecureRandom . uuid , offset : 2 , next : SecureRandom . uuid )
464+ @client . search ( { members : { '$in' => [ 'legoblast ' ] } } , SecureRandom . uuid , offset : 2 , next : SecureRandom . uuid )
465465 end . to raise_error ( /cannot use offset with next or sort parameters/ )
466466 end
467467
468468 xit 'search for messages with sorting' do
469469 text = SecureRandom . uuid
470470 message_ids = [ "0-#{ text } " , "1-#{ text } " ]
471- @channel . send_message ( { id : message_ids [ 0 ] , text : text } , 'legolas ' )
472- @channel . send_message ( { id : message_ids [ 1 ] , text : text } , 'legolas ' )
473- page1 = @client . search ( { members : { '$in' => [ 'legolas ' ] } } , text , sort : [ { created_at : -1 } ] , limit : 1 )
471+ @channel . send_message ( { id : message_ids [ 0 ] , text : text } , 'legoblast ' )
472+ @channel . send_message ( { id : message_ids [ 1 ] , text : text } , 'legoblast ' )
473+ page1 = @client . search ( { members : { '$in' => [ 'legoblast ' ] } } , text , sort : [ { created_at : -1 } ] , limit : 1 )
474474 expect ( page1 [ 'results' ] . length ) . to eq
475475 expect ( page1 [ 'results' ] [ 0 ] [ 'message' ] [ 'id' ] ) . to eq ( message_ids [ 1 ] )
476476 expect ( page1 [ 'next' ] ) . not_to be_empty
477- page2 = @client . search ( { members : { '$in' => [ 'legolas ' ] } } , text , limit : 1 , next : page1 [ 'next' ] )
477+ page2 = @client . search ( { members : { '$in' => [ 'legoblast ' ] } } , text , limit : 1 , next : page1 [ 'next' ] )
478478 expect ( page2 [ 'results' ] . length ) . to eq ( 1 )
479479 expect ( page2 [ 'results' ] [ 0 ] [ 'message' ] [ 'id' ] ) . to eq ( message_ids [ 0 ] )
480480 expect ( page2 [ 'previous' ] ) . not_to be_empty
@@ -697,7 +697,7 @@ def loop_times(times)
697697
698698 it 'check push notification test are working' do
699699 message_id = SecureRandom . uuid
700- @channel . send_message ( { id : message_id , text : SecureRandom . uuid } , 'legolas ' )
700+ @channel . send_message ( { id : message_id , text : SecureRandom . uuid } , 'legoblast ' )
701701 resp = @client . check_push ( { message_id : message_id , skip_devices : true , user_id : @random_user [ :id ] } )
702702 expect ( resp [ 'rendered_message' ] ) . not_to be_empty
703703 end
@@ -727,7 +727,7 @@ def loop_times(times)
727727
728728 it 'can translate a message' do
729729 message_id = SecureRandom . uuid
730- @channel . send_message ( { id : message_id , text : SecureRandom . uuid } , 'legolas ' )
730+ @channel . send_message ( { id : message_id , text : SecureRandom . uuid } , 'legoblast ' )
731731 response = @client . translate_message ( message_id , 'hu' )
732732 expect ( response [ 'message' ] ) . not_to be_empty
733733 end
0 commit comments