CartoDB-SQL-API/test
Sandro Santilli 0f17889b05 Really fix the tests for unauthorized attempts to write db
It was not about specifying the db trough headers but rather
about referencing the _wrong_ database via params. Also fixes
the expected result (which was indeed wrong).
2013-04-11 13:35:11 +02:00
..
acceptance Really fix the tests for unauthorized attempts to write db 2013-04-11 13:35:11 +02:00
support Put a copy of CDB_* functions from cartodb to this repo 2012-10-15 13:15:48 +02:00
unit Upgrade generic-pool to ~2.0.2 2013-03-14 11:58:30 +01:00
helper.js first draft, tidied, unit tests, modules, refactor, environments, see TODO for next steps" 2011-06-13 04:23:02 +01:00
prepare_db.sh Put a copy of CDB_* functions from cartodb to this repo 2012-10-15 13:15:48 +02:00
README.md Update after port to mocha 2012-07-13 10:30:46 +02:00
run_tests.sh Fix exit code from test runner 2013-04-11 13:22:47 +02:00
test.sql Put a copy of CDB_* functions from cartodb to this repo 2012-10-15 13:15:48 +02:00

cartodb-sql-api tests

Tests require you create a test database and set some redis keys before, you can execute prepare_db.sh script, it will create database, users and redis stuff for you. Be sure postgres and redis are running.

cd test && ./prepare_db.sh

Note that "make check" from top-level dir will try to do everything needed to prepare & run the tests.

Acceptance tests (need ctrl-C to exit)

mocha -u tdd test/acceptance/app.test.js mocha -u tdd test/acceptance/app.auth.test.js

Unit tests

mocha -u tdd test/unit/*.js (or run the tests individually)