Produced by Araxis Merge on 10/4/2017 8:04:34 AM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | rdk.zip\rdk\product\production\rdk\src\resources\authentication\api | get-session-spec.js | Mon Aug 21 12:51:00 2017 UTC |
| 2 | rdk.zip\rdk\product\production\rdk\src\resources\authentication\api | get-session-spec.js | Tue Oct 3 17:16:19 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 158 |
| Changed | 1 | 4 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | 'use stric t'; | |
| 2 | ||
| 3 | var _ = re quire('lod ash'); | |
| 4 | var bunyan = require ('bunyan') ; | |
| 5 | var httpMo cks = requ ire('node- mocks-http '); | |
| 6 | var auth = require(' ./get-sess ion'); | |
| 7 | ||
| 8 | var validD uz = ' R E DACT '; | |
| 9 | var validP wd = ' R E DACT '; | |
| 10 | var divisi on = '500' ; | |
| 11 | var invali dSite = '1 337'; | |
| 12 | ||
| 13 | function b uildReques t(accessCo de, verify Code, site , disabled ) { | |
| 14 | var he aders = {} ; | |
| 15 | ||
| 16 | var re quest = ht tpMocks.cr eateReques t({ | |
| 17 | me thod: 'GET ', | |
| 18 | ur l: '/authe nticate', | |
| 19 | bo dy: { | |
| 20 | accessCo de: (acces sCode || ' '), | |
| 21 | verifyCo de: (verif yCode || ' '), | |
| 22 | site: (s ite || '') , | |
| 23 | division : (divisio n || '') | |
| 24 | } | |
| 25 | }); | |
| 26 | ||
| 27 | reques t.get = fu nction(hea der) { | |
| 28 | re turn heade rs[header] ; | |
| 29 | }; | |
| 30 | ||
| 31 | reques t.logger = sinon.stu b(bunyan.c reateLogge r({ | |
| 32 | na me: 'api-g et-session -resource' | |
| 33 | })); | |
| 34 | ||
| 35 | _.set( request, ' app.config .intercept ors.authen tication.d isabled', (disabled || false)) ; | |
| 36 | _.set( request, ' audit', {} ); | |
| 37 | _.set( request, ' session', { | |
| 38 | de stroy: fun ction() {} | |
| 39 | }); | |
| 40 | _.set( request, [ 'app', 'co nfig', 'vi staSites', site], {} ); | |
| 41 | ||
| 42 | return request; | |
| 43 | } | |
| 44 | ||
| 45 | describe(' Authentica tion Resou rce', func tion() { | |
| 46 | it('re jects the login atte mpt if the re are no credential s', functi on() { | |
| 47 | va r next = s inon.spy() ; | |
| 48 | va r req = bu ildRequest (); | |
| 49 | _. set(req, ' _resourceC onfigItem. title', 'a uthenticat ion-authen ticate'); | |
| 50 | _. set(req, ' _resourceC onfigItem. rel', 'vha .create'); | |
| 51 | va r res = {} ; | |
| 52 | re s.status = function( status) { | |
| 53 | this.sta tus = stat us; | |
| 54 | return t his; | |
| 55 | }; | |
| 56 | re s.rdkSend = function (body) { | |
| 57 | expect(b ody.code). to.match(/ 200.400.10 01/); | |
| 58 | expect(t his.status ).to.equal (400); | |
| 59 | }; | |
| 60 | au th(req, re s, next); | |
| 61 | }); | |
| 62 | it('re jects the login atte mpt if the re is a ba d site', f unction() { | |
| 63 | va r next = s inon.spy() ; | |
| 64 | va r req = bu ildRequest (validDuz, validPwd, invalidSi te); | |
| 65 | _. set(req, ' _resourceC onfigItem. title', 'a uthenticat ion-authen ticate'); | |
| 66 | _. set(req, ' _resourceC onfigItem. rel', 'vha .create'); | |
| 67 | va r res = {} ; | |
| 68 | re s.status = function( status) { | |
| 69 | this.sta tus = stat us; | |
| 70 | return t his; | |
| 71 | }; | |
| 72 | re s.rdkSend = function (body) { | |
| 73 | expect(b ody.code). to.match(/ 200.400.10 02/); | |
| 74 | expect(t his.status ).to.equal (400); | |
| 75 | }; | |
| 76 | au th(req, re s, next); | |
| 77 | }); | |
| 78 | /** | |
| 79 | * TOD O add test s for the handle log in attempt and other callbacks | |
| 80 | */ | |
| 81 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.