find.where.not.in.test.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. var Test = require('../../support/convert-runner');
  2. describe('Converter :: ', function() {
  3. describe('Find Where Not In :: ', function() {
  4. it('should generate a find query', function() {
  5. Test({
  6. criteria: {
  7. model: 'user',
  8. method: 'find',
  9. criteria: {
  10. where: {
  11. and: [
  12. {
  13. firstName: 'Test'
  14. },
  15. {
  16. age: {
  17. nin: [40, 20, 10]
  18. }
  19. }
  20. ]
  21. }
  22. }
  23. },
  24. query: {
  25. select: [],
  26. from: 'user',
  27. where: {
  28. and: [
  29. {
  30. firstName: 'Test'
  31. },
  32. {
  33. age: {
  34. nin: [40, 20, 10]
  35. }
  36. }
  37. ]
  38. }
  39. }
  40. });
  41. });
  42. it('should generate a find query when the NOT is a legacy value', function() {
  43. Test({
  44. criteria: {
  45. model: 'user',
  46. method: 'find',
  47. criteria: {
  48. where: {
  49. and: [
  50. {
  51. firstName: 'Test'
  52. },
  53. {
  54. age: {
  55. nin: [40, 20, 10]
  56. }
  57. }
  58. ]
  59. }
  60. }
  61. },
  62. query: {
  63. select: [],
  64. from: 'user',
  65. where: {
  66. and: [
  67. {
  68. firstName: 'Test'
  69. },
  70. {
  71. age: {
  72. nin: [40, 20, 10]
  73. }
  74. }
  75. ]
  76. }
  77. }
  78. });
  79. });
  80. });
  81. });