From eeafaf7d42f5bc9243c0fcf2693f8cd7bf971ac8 Mon Sep 17 00:00:00 2001 From: Joe Fleming Date: Mon, 6 Jun 2016 17:22:36 -0700 Subject: [PATCH] add test for assign headers --- test/src/job.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/src/job.js b/test/src/job.js index 17917e9..7b4ad7f 100644 --- a/test/src/job.js +++ b/test/src/job.js @@ -210,6 +210,15 @@ describe('Job Class', function () { expect(indexArgs.body).to.have.property('priority', minPriority); }); }); + + it('should pass headers to the client', function () { + const headers = { authorization: 'Basic dXNlcjpwYXNzd29yZA==' }; + const job = new Job(client, index, type, payload, Object.assign(options, { headers })); + return job.ready.then(() => { + const indexArgs = validateDoc(client.index); + expect(indexArgs).to.have.property('headers', headers); + }); + }); }); describe('custom client', function () {