From 8ad38ed655f938ddd0b7e38a3eab1129fb85ea15 Mon Sep 17 00:00:00 2001 From: jacoblurie29 Date: Sat, 24 Feb 2024 21:43:03 -0500 Subject: [PATCH] Change route for accompanying passenger --- src/routes/routes.ts | 2 +- src/tests/Passenger.tests.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/routes/routes.ts b/src/routes/routes.ts index 20fc663..bf00071 100644 --- a/src/routes/routes.ts +++ b/src/routes/routes.ts @@ -32,7 +32,7 @@ const routes = (app: Express) => { app.get('/test/retrievePassengers', retrievePassengers); /* Passenger Controller Routes */ - app.get('/passenger/', getAllPassengersForUser); + app.get('/passenger/accompanying', getAllPassengersForUser); app.get('/passenger/:id', getPassengerById); app.post('/passenger/', createPassenger); app.put('/passenger/:id', updatePassenger); diff --git a/src/tests/Passenger.tests.ts b/src/tests/Passenger.tests.ts index 2e1fc1b..56807a5 100644 --- a/src/tests/Passenger.tests.ts +++ b/src/tests/Passenger.tests.ts @@ -29,11 +29,11 @@ after(done => { // describe is group of tests // it is the actual test itself // Test case -describe('GET /passenger', () => { +describe('GET /passenger/accompanying', () => { it('should return a 400 response', done => { chai .request(app) - .get('/passenger') + .get('/passenger/accompanying') .query({ id: '' }) .end((err, res) => { expect(res).to.have.status(400); @@ -43,7 +43,7 @@ describe('GET /passenger', () => { it('should be an accompanying passenger', done => { chai .request(app) - .get('/passenger') + .get('/passenger/accompanying') .query({ id: 'recleNlsBm3dheZHy' }) .end((err, res) => { expect(res.body[0]['First Name']).to.be.oneOf([ @@ -58,7 +58,7 @@ describe('GET /passenger', () => { it('should be an accompanying passenger', done => { chai .request(app) - .get('/passenger') + .get('/passenger/accompanying') .query({ id: 'recleNlsBm3dheZHy' }) .end((err, res) => { expect(res.body[1]['Gender']).to.equal('Male'); @@ -69,7 +69,7 @@ describe('GET /passenger', () => { it('should be an accompanying passenger', done => { chai .request(app) - .get('/passenger') + .get('/passenger/accompanying') .query({ id: 'recleNlsBm3dheZHy' }) .end((err, res) => { expect(res.body[2]['Relationship']).to.be.oneOf(['Father', undefined]);