aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjw2552018-03-07 15:17:56 +0000
committerjw2552018-03-07 15:17:56 +0000
commit6d4587d27f6f47329b0372a261784b76a7f0aced (patch)
treef7a72001282b18a01623e8b1936237dafd0497d7
parent... (diff)
downloadmedicine-6d4587d27f6f47329b0372a261784b76a7f0aced.tar.gz
medicine-6d4587d27f6f47329b0372a261784b76a7f0aced.zip

small fix

-rw-r--r--package.json2
-rw-r--r--src/db/initPostgresDB.ts2
-rw-r--r--test/integration/auth.routes.test.ts8
3 files changed, 10 insertions, 2 deletions
diff --git a/package.json b/package.json
index 0450ba0..fadb260 100644
--- a/package.json
+++ b/package.json
@@ -7,7 +7,7 @@
"test": "mocha --reporter spec -r ts-node/register './test/**/*.test.ts'",
"test:routes": "mocha --reporter spec -r ts-node/register './test/**/*.routes.test.ts'",
"test:unit": "mocha --reporter spec -r ts-node/register './test/**/*.unit.test.ts'",
- "test:db": "mocha --reporter spec -r ts-node/register './test/**/*database.unit.test.ts'",
+ "test:routes:db": "mocha --reporter spec -r ts-node/register './test/**/*database.unit.test.ts'",
"test:routes:auth": "mocha --reporter spec -r ts-node/register './test/**/*auth.routes.test.ts'",
"test:routes:index": "mocha --reporter spec -r ts-node/register './test/**/*index.routes.test.ts'",
"test:routes:protocol": "mocha --reporter spec -r ts-node/register './test/**/*protocol.routes.test.ts'",
diff --git a/src/db/initPostgresDB.ts b/src/db/initPostgresDB.ts
index b6844d9..eb979f4 100644
--- a/src/db/initPostgresDB.ts
+++ b/src/db/initPostgresDB.ts
@@ -1,6 +1,6 @@
import * as Sequelize from 'sequelize';
const gres: Sequelize.Sequelize = new Sequelize(
- 'postgres://admin:eprprJacR0hBpmWvs5IDJZTnjRAY2gM3tSm0b1af@postgres:5432/be4',
+ 'postgres://admin:eprprJacR0hBpmWvs5IDJZTnjRAY2gM3tSm0b1af@localhost:5432/be4',
{
operatorsAliases : false
}
diff --git a/test/integration/auth.routes.test.ts b/test/integration/auth.routes.test.ts
index 888883f..c8a509d 100644
--- a/test/integration/auth.routes.test.ts
+++ b/test/integration/auth.routes.test.ts
@@ -72,6 +72,14 @@ before((done: any) => {
describe('authentication', () => {
context('invalid password authentication', () => {
+ it('should reject login to invalid endpoints', () => {
+ chai.request(app)
+ .post('/')
+ .send({...bobbyCredentials})
+ .then((res) => {
+ expect(res).to.have.status(400);
+ });
+ });
it('should reject invalid usernames', () => {
chai.request(app)
.post('/cs3099group-be-4/login')