#NEWLINE# def test_touch_method_syncs_timestamps( self ) : #NEWLINE# #INDENT# relation = self . _get_relation ( ) #NEWLINE# relation . get_related ( ) . should_receive ( 'get_updated_at_column' ) . and_return ( 'updated_at' ) #NEWLINE# now = arrow . get ( ) . naive #NEWLINE# relation . get_related ( ) . should_receive ( 'fresh_timestamp' ) . and_return ( query ) #NEWLINE# relation . get_related ( ) . should_receive ( 'get_qualified_key_name' ) . and_return ( 'table.id' ) #NEWLINE# relation . get_query ( ) . get_query ( ) . should_receive ( 'select' ) . once ( ) . with_args ( 'table.id' ) . and_return ( relation . get_query ( ) . get_query ( ) ) #NEWLINE# relation . get_query ( ) . should_receive ( 'lists' ) . once ( ) . and_return ( [ 1 , 2 , 3 ] ) #NEWLINE# query = flexmock ( ) #NEWLINE# relation . get_related ( ) . should_receive ( 'new_query' ) . once ( ) . and_return ( query ) #NEWLINE# query . should_receive ( 'where_in' ) . once ( ) . with_args ( 'id' , [ 1 , 2 , 3 ] ) . and_return ( query ) #NEWLINE# query . should_receive ( 'update' ) . once ( ) . with_args ( { #NEWLINE# #INDENT# 'updated_at' : now , #NEWLINE# #UNINDENT# } ) #NEWLINE# relation . touch ( )