Exemplo n.º 1
0
 it('should return sql for checking relations where entities are siblings', () => {
   const sql = relationsChecker._getSql('users', 'boards', [10, 5]);
   assert.equal(sql,
     "SELECT * FROM users_boards AS p " +
     "WHERE user_id = '10' AND board_id = '5'"
   );
 });
Exemplo n.º 2
0
 it('should return sql for checking relations where between entities 1 entity', () => {
   const sql = relationsChecker._getSql('users', 'lists', [10, 5]);
   assert.equal(sql,
     "SELECT * FROM users_boards AS p " +
     "JOIN boards_lists AS t1 ON (p.board_id = t1.board_id)" +
     "WHERE user_id = '10' AND list_id = '5'"
   );
 });