Produced by Araxis Merge on 10/4/2017 8:04:35 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\subsystems\asu | asu-process-spec.js | Mon Aug 21 12:51:00 2017 UTC |
| 2 | rdk.zip\rdk\product\production\rdk\src\subsystems\asu | asu-process-spec.js | Tue Oct 3 17:18:06 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 8 | 128 |
| Changed | 7 | 14 |
| 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 asu_pr ocess = re quire('./a su-process '); | |
| 4 | var nock = require(' nock'); | |
| 5 | var logger ; | |
| 6 | ||
| 7 | ||
| 8 | describe(' Asu test', function( ) { | |
| 9 | ||
| 10 | var ge tDocPermis sionResult ='[{"actio nName": "V IEW","hasP ermission" : true},{" actionName ": "EDIT R ECORD","ha sPermissio n": false} ]'; | |
| 11 | var de tails='{\" data\":{\" items\":[{ \"author\" :\"VEHU,ON E\",\"auth orDisplayN ame\":\"Ve hu,One\",\ "authorUid \":\"urn:v a:user:C87 7:20001\", \"clinicia ns\":[{\"d isplayName \":\"Vehu, One\",\"na me\":\"VEH U,ONE\",\" role\":\"A U\",\"summ ary\":\"Do cumentClin ician{uid= \'urn:va:u ser:C877:2 0001\'}\", \"uid\":\" urn:va:use r:C877:200 01\"}],\"d ocumentDef Uid\":\"ur n:va:doc-d ef:C877:8\ ",\"status \":\"COMPL ETED\",\"u id\":\"urn :va:docume nt:C877:3: 11605\"}]} ,\"actionN ames\":[\" VIEW\",\"E DIT RECORD \",\"AMEND MENT\"],\" userdetail s\":{\"sit e\":\"C877 \",\"duz\" :{\"C877\" :\"1000000 0270\"}}}' ; | |
| 12 | var de faultUserC lassResult ='{\"apiVe rsion\":\" 1.0\",\"da ta\":{\"up dated\":20 1512081133 30,\"total Items\":2, \"currentI temCount\" :2,\"items \":[{\"abb reviation\ ":\"USR\", \"active\" :true,\"di splayName\ ":\"User\" ,\"localId \":561,\"n ame\":\"US ER\",\"sta mpTime\":2 0151202115 611,\"subC lass\":[{\ "name\":\" PROVIDER\" ,\"uid\":\ "urn:va:as u-class:9E 7A:546\"}, {\"name\": \"MEDICAL INFORMATIO N SECTION\ ",\"uid\": \"urn:va:a su-class:9 E7A:555\"} ,{\"name\" :\"REMOTE USER\",\"u id\":\"urn :va:asu-cl ass:9E7A:4 14\"}],\"u id\":\"urn :va:asu-cl ass:9E7A:5 61\"},{\"a bbreviatio n\":\"USR\ ",\"active \":true,\" displayNam e\":\"User \",\"local Id\":561,\ "name\":\" USER\",\"s tampTime\" :201512021 15608,\"su bClass\":[ {\"name\": \"PROVIDER \",\"uid\" :\"urn:va: asu-class: C877:546\" },{\"name\ ":\"MEDICA L INFORMAT ION SECTIO N\",\"uid\ ":\"urn:va :asu-class :C877:555\ "},{\"name \":\"REMOT E USER\",\ "uid\":\"u rn:va:asu- class:C877 :414\"}],\ "uid\":\"u rn:va:asu- class:C877 :561\"}]}} '; | |
| 13 | ||
| 14 | before Each(funct ion () { | |
| 15 | lo gger = req uire('buny an').creat eLogger({ | |
| 16 | name: 'a su-process -spec.js' | |
| 17 | }) ; | |
| 18 | no ck.cleanAl l(); | |
| 19 | no ck.disable NetConnect (); | |
| 20 | ||
| 21 | nock('http :// IP ') | |
| 22 | .get('/d ata/find/a su-class?f ilter=eq(% 22name%22, %22USER%22 )') | |
| 23 | .reply(2 00, | |
| 24 | defaultU serClassRe sult); | |
| 25 | ||
| 26 | nock('http :// IP ') | |
| 27 | .post('/ asu/rules/ getDocPerm issions') | |
| 28 | .reply(2 00, | |
| 29 | '[{"acti onName": " VIEW","has Permission ": true},{ "actionNam e": "EDIT RECORD","h asPermissi on": false }]'); | |
| 30 | }); | |
| 31 | ||
| 32 | ||
| 33 | it('ge t getDefau ltUserClas s', functi on (done) { | |
| 34 | va r req = {} ; | |
| 35 | re q.app = {} ; | |
| 36 | re q.audit = {}; | |
| 37 | re q.logger = logger; | |
| 38 | re q.app.conf ig = {}; | |
| 39 | re q.session = {}; | |
| 40 | re q.app.conf ig.vxSyncS erver = {} ; | |
| 41 | req.app.co nfig.vxSyn cServer.ba seUrl = 'h ttp:// IP '; | |
| 42 | re q.app.conf ig.jdsServ er = {}; | |
| 43 | req.app.co nfig.jdsSe rver.baseU rl = 'http :// IP '; | |
| 44 | as u_process. getDefault UserClass( req, funct ion (error , response , body) { | |
| 45 | done(); | |
| 46 | expect(b ody).to.eq l(defaultU serClassRe sult); | |
| 47 | }) ; | |
| 48 | }); | |
| 49 | ||
| 50 | it('te st getAsuP ermissionF orActionNa mes', func tion (done ) { | |
| 51 | va r mock; | |
| 52 | va r req = {} ; | |
| 53 | re q.app = {} ; | |
| 54 | re q.audit = {}; | |
| 55 | re q.logger = logger; | |
| 56 | re q.app.conf ig = {}; | |
| 57 | re q.session = {}; | |
| 58 | re q.app.conf ig.asuServ er = {}; | |
| 59 | req.app.co nfig.asuSe rver.baseU rl = 'http :// IP '; | |
| 60 | re q.app.conf ig.vxSyncS erver = {} ; | |
| 61 | req.app.co nfig.vxSyn cServer.ba seUrl = 'h ttp:// IP '; | |
| 62 | re q.app.conf ig.jdsServ er = {}; | |
| 63 | req.app.co nfig.jdsSe rver.baseU rl = 'http :// IP '; | |
| 64 | mo ck = sinon .spy(asu_p rocess, 'g etAsuPermi ssion'); | |
| 65 | as u_process. getAsuPerm issionForA ctionNames (req, JSON .parse(det ails), fun ction (asu Error, asu Result) { | |
| 66 | done(); | |
| 67 | expect( asuResult) .to.eql(JS ON.parse(g etDocPermi ssionResul t)); | |
| 68 | }) ; | |
| 69 | }); | |
| 70 | ||
| 71 | }); |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.