@@ -1038,17 +1038,19 @@ def loop_times(times)
10381038 end
10391039
10401040 it 'can create and update a location' do
1041- location = {
1041+ location = {
10421042 created_by_device_id : SecureRandom . uuid ,
10431043 latitude : 40.7128 ,
10441044 longitude : -74.0060 ,
10451045 end_at : ( Time . now + 3600 ) . iso8601
10461046 }
10471047
1048- response = @channel . send_message ( {
1049- text : 'Location sharing message' ,
1050- shared_location : location ,
1051- } , @location_test_user [ :id ] )
1048+ response = @channel . send_message (
1049+ {
1050+ text : 'Location sharing message' ,
1051+ shared_location : location
1052+ } , @location_test_user [ :id ]
1053+ )
10521054
10531055 expect ( response [ 'message' ] ) . to include 'shared_location'
10541056 expect ( response [ 'message' ] [ 'shared_location' ] [ 'created_by_device_id' ] ) . to eq ( location [ :created_by_device_id ] )
@@ -1076,21 +1078,22 @@ def loop_times(times)
10761078 longitude = -74.0060
10771079 end_at = ( Time . now + 3600 ) . iso8601
10781080
1079- response = @location_channel . send_message ( {
1080- text : 'Location sharing message' ,
1081- shared_location : {
1082- created_by_device_id : device_id ,
1083- latitude : latitude ,
1084- longitude : longitude ,
1085- end_at : end_at
1086- }
1087- } , @location_test_user [ :id ] )
1081+ response = @location_channel . send_message (
1082+ {
1083+ text : 'Location sharing message' ,
1084+ shared_location : {
1085+ created_by_device_id : device_id ,
1086+ latitude : latitude ,
1087+ longitude : longitude ,
1088+ end_at : end_at
1089+ }
1090+ } , @location_test_user [ :id ]
1091+ )
10881092
10891093 response = @client . get_active_live_locations ( @location_test_user [ :id ] )
10901094 expect ( response ) . to include 'active_live_locations'
10911095 expect ( response [ 'active_live_locations' ] ) . to be_an ( Array )
10921096 expect ( response [ 'active_live_locations' ] . length ) . to be >= 1
1093-
10941097 location = response [ 'active_live_locations' ] . find { |loc | loc [ 'created_by_device_id' ] == device_id }
10951098 expect ( location ) . not_to be_nil
10961099 expect ( location [ 'latitude' ] ) . to eq ( latitude )
@@ -1099,7 +1102,7 @@ def loop_times(times)
10991102 end
11001103
11011104 it 'should have active live locations on the channel' do
1102- response = @channel . query ( )
1105+ response = @channel . query
11031106 expect ( response ) . to include 'active_live_locations'
11041107 expect ( response [ 'active_live_locations' ] . length ) . to be >= 1
11051108 end
0 commit comments