不要怂,就是干,撸起袖子干!

You need to sign in or sign up before continuing.
Commit 6bc272bf by Ivan Popovski

group by + array tests

1 parent 784a941c
...@@ -78,6 +78,14 @@ describe('QueryGenerator', function() { ...@@ -78,6 +78,14 @@ describe('QueryGenerator', function() {
expectation: "SELECT * FROM `myTable` GROUP BY `name`;", expectation: "SELECT * FROM `myTable` GROUP BY `name`;",
context: QueryGenerator context: QueryGenerator
}, { }, {
arguments: ['myTable', {group: ["name"]}],
expectation: "SELECT * FROM `myTable` GROUP BY `name`;",
context: QueryGenerator
}, {
arguments: ['myTable', {group: ["name", "title"]}],
expectation: "SELECT * FROM `myTable` GROUP BY `name`, `title`;",
context: QueryGenerator
}, {
arguments: ['myTable', {group: "name", order: "id DESC"}], arguments: ['myTable', {group: "name", order: "id DESC"}],
expectation: "SELECT * FROM `myTable` GROUP BY `name` ORDER BY id DESC;", expectation: "SELECT * FROM `myTable` GROUP BY `name` ORDER BY id DESC;",
context: QueryGenerator context: QueryGenerator
......
...@@ -72,6 +72,12 @@ describe('QueryGenerator', function() { ...@@ -72,6 +72,12 @@ describe('QueryGenerator', function() {
arguments: ['myTable', {group: "name"}], arguments: ['myTable', {group: "name"}],
expectation: "SELECT * FROM \"myTable\" GROUP BY \"name\";" expectation: "SELECT * FROM \"myTable\" GROUP BY \"name\";"
}, { }, {
arguments: ['myTable', {group: ["name"]}],
expectation: "SELECT * FROM \"myTable\" GROUP BY \"name\";"
}, {
arguments: ['myTable', {group: ["name","title"]}],
expectation: "SELECT * FROM \"myTable\" GROUP BY \"name\", \"title\";"
}, {
arguments: ['myTable', {limit: 10}], arguments: ['myTable', {limit: 10}],
expectation: "SELECT * FROM \"myTable\" LIMIT 10;" expectation: "SELECT * FROM \"myTable\" LIMIT 10;"
}, { }, {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!