create.test.js 904 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. var Test = require('../../support/convert-runner');
  2. describe('Converter :: ', function() {
  3. describe('Create :: ', function() {
  4. it('should generate a create query', function() {
  5. Test({
  6. criteria: {
  7. model: 'user',
  8. method: 'create',
  9. values: {
  10. firstName: 'foo'
  11. }
  12. },
  13. query: {
  14. insert: {
  15. firstName: 'foo'
  16. },
  17. into: 'user'
  18. }
  19. });
  20. });
  21. it('should generate a create query with multiple values', function() {
  22. Test({
  23. criteria: {
  24. model: 'user',
  25. method: 'create',
  26. values: {
  27. firstName: 'foo',
  28. lastName: 'bar'
  29. }
  30. },
  31. query: {
  32. insert: {
  33. firstName: 'foo',
  34. lastName: 'bar'
  35. },
  36. into: 'user'
  37. }
  38. });
  39. });
  40. });
  41. });