From 4f8bdb9d52cc0b9f7a1e2a65b5feb271eb489a5e Mon Sep 17 00:00:00 2001 From: Akiva Levy Date: Fri, 24 Dec 2021 10:52:14 -0800 Subject: [PATCH] Fix authorization header typo in tests --- lib/auth/controller.test.js | 4 ++-- lib/users/controller.test.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/auth/controller.test.js b/lib/auth/controller.test.js index 7ce65be..5866f7c 100644 --- a/lib/auth/controller.test.js +++ b/lib/auth/controller.test.js @@ -146,7 +146,7 @@ test('Auth controller', function (t) { st.plan(2) const response = res() const ctrlr = controller(req({ - headers: { 'Authorization': 'Bearer 123' }, + headers: { 'authorization': 'Bearer 123' }, }), response) ctrlr.verifyToken(() => {}) .catch(e => { @@ -172,7 +172,7 @@ test('Auth controller', function (t) { .then(user => { const request = req({ headers: { - 'Authorization': 'Bearer ' + JSON.parse(user).accessToken + 'authorization': 'Bearer ' + JSON.parse(user).accessToken }, }) return controller(request, res()) diff --git a/lib/users/controller.test.js b/lib/users/controller.test.js index 6e3f801..721f906 100644 --- a/lib/users/controller.test.js +++ b/lib/users/controller.test.js @@ -34,7 +34,7 @@ function authenticateUser(user, req, res) { } return authController(req, res).login() }) - .then(user => req.headers['Authorization'] = + .then(user => req.headers['authorization'] = 'Bearer ' + JSON.parse(user).accessToken ) } -- 2.45.2