-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
28 lines (22 loc) · 1.33 KB
/
Makefile
File metadata and controls
28 lines (22 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
TEST_DATABASE = http://localhost:7070/sql/node
TEST_JSON = http://localhost:7070/json/node
CREDENTIALS = "top:secret"
run:
node runner.js
dependencies:
git submodule update --init lib/node-postgres
git submodule update --init lib/node-elf-logger
git submodule update --init lib/underscore
tests:
vows --spec tests.js
test_insert:
curl -u $(CREDENTIALS) -X POST --data "drop table persons" $(TEST_DATABASE)
curl -u $(CREDENTIALS) -X POST --data "create table persons(id serial not null primary key, name varchar(50))" $(TEST_DATABASE)
curl -u $(CREDENTIALS) -X POST --data "insert into persons(name) values('Pierre Niemans')" $(TEST_DATABASE)
curl -u $(CREDENTIALS) -X POST --data "insert into persons(name) values('Max Kerkerian')" $(TEST_DATABASE)
curl -u $(CREDENTIALS) -X POST --data "insert into persons(name) values('Fanny Ferreira')" $(TEST_DATABASE)
curl -u $(CREDENTIALS) -X POST --data "select * from persons" $(TEST_DATABASE)
test_json:
curl -u $(CREDENTIALS) -X POST --data '{"table": "persons", "data": [{"conditions": {"id":2 }, "values": {"name": "Judith Hérault (update)"}}]}' $(TEST_JSON)
curl -u $(CREDENTIALS) -X POST --data '{"table": "persons", "data": [{"conditions": {"id":4}, "values": {"name": "Judith Hérault (insert)"}}]}' $(TEST_JSON)
curl -u $(CREDENTIALS) -X POST --data "select * from persons" $(TEST_DATABASE)