277. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 10/4/2017 8:04:41 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.

277.1 Files compared

# Location File Last Modified
1 rdk.zip\rdk\product\tests\acceptance-tests\features\steps permission-sets.rb Mon Aug 21 12:51:01 2017 UTC
2 rdk.zip\rdk\product\tests\acceptance-tests\features\steps permission-sets.rb Tue Oct 3 20:11:35 2017 UTC

277.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 6 346
Changed 5 10
Inserted 0 0
Removed 0 0

277.3 Comparison options

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

277.4 Active regular expressions

No regular expressions were active.

277.5 Comparison detail

  1   When(/^the  client re quests to  view all u ser permis sion sets$ /) do 
  2     query =  RDKQuery.n ew('permis sion-sets- list')
  3     query.ad d_paramete r('testdat a', 'true' )
  4     path = q uery.path
  5     p path
  6       @response  = HTTParty RDK.get_as _user(path , " R E D A CTED ; DNS     ", " REDACTED ")
  7   end
  8  
  9   When(/^the  client re quests to  view permi ssion sets  for a spe cific user  "(.*?)"$/ ) do |uid|
  10     query =  RDKQuery.n ew('permis sion-sets- getUserPer missionSet s')
  11     query.ad d_paramete r('uid', u id)
  12     path = q uery.path
  13     p path
  14       @response  = HTTParty RDK.get_as _user(path , " R E D A CTED ; DNS     ", " REDACTED ")
  15   end
  16  
  17   When(/^the  client re quests to  update use r permissi on sets wi th content  "(.*?)"$/ ) do |cont ent|
  18     query =  RDKQuery.n ew('permis sion-sets- edit')
  19     path = q uery.path
  20     p path
  21       @response  = HTTParty RDK.put_as _user(path , " R E D A CTED ; DNS     ", " REDACTED ", content , { "Conte nt-Type" = > "applica tion/json"  })
  22   end
  23  
  24   Then(/^the  permissio n sets res ults conta in more th an (\d+) r ecords$/)  do |count|
  25     json = J SON.parse( @response. body)
  26     value =  json["data "]   #resu lts  in on ly one val ue
  27     expect(v alue.lengt h).to be >  count.to_ i
  28   end
  29  
  30   Then(/^the  permissio n sets res ults conta in exactly  (\d+) val ues$/) do  |count|
  31     @json_ob ject = JSO N.parse(@r esponse.bo dy)
  32     json = J SON.parse( @response. body)
  33  
  34     p json
  35     expect(@ json_objec t['data']) .to_not be _nil, "exp ected resp onse ['dat a'] to not  be nil"
  36     expect(@ json_objec t['data'][ 'val']).to _not be_ni l, "Expect ed respons e ['data'] ['val'] to  not be ni l"
  37  
  38     permissi on_sets =  @json_obje ct["data"] ["val"]
  39     expect(p ermission_ sets.lengt h).to eq(c ount.to_i)
  40   end
  41  
  42   Then(/^the  response  contains p ermission  sets$/) do  |table|
  43     @json_ob ject = JSO N.parse(@r esponse.bo dy)
  44     permissi on_sets =  @json_obje ct["data"] ["val"]
  45     table.ro ws.each do  |row|
  46       expect (permissio n_sets.inc lude? row[ 0]).to eq( true)
  47     end
  48   end
  49  
  50   class Buil dContent
  51     def get_ hash_key(t emp_key)
  52       return  temp_key  unless tem p_key.end_ with? '[]'
  53       return  temp_key. sub('[]',  '')
  54     end
  55  
  56     def key_ is_array(t emp_key)
  57       temp_k ey.end_wit h? '[]'
  58     end
  59  
  60     def buil d_from_cuc umber_tabl e(table)
  61       conten t_body = { }
  62       table. rows.each  do | path,  value |
  63         keys  = path.sp lit('.')
  64         temp _content =  content_b ody
  65         keys .each_with _index do  | key, ind ex |
  66           st ripped_key  = get_has h_key key
  67           if  key_is_ar ray(key)  
  68              temp_conte nt[strippe d_key] = [ ] unless t emp_conten t.key?(str ipped_key)
  69              temp_conte nt[strippe d_key].pus h(value) i f value.le ngth > 0
  70           el se
  71              temp_conte nt[key] =  {} unless  temp_conte nt.key? ke y      
  72              if index = = keys.len gth - 1
  73                temp_con tent[key]  = value
  74              end
  75           en d
  76           te mp_content  = temp_co ntent[key]
  77         end    
  78       end
  79       conten t_body
  80     end
  81   end
  82  
  83   When(/^the  client re quests to  update use r permissi on sets wi th body$/)  do |table |
  84     content_ body = {}
  85     content_ body = Bui ldContent. new.build_ from_cucum ber_table  table
  86     p conten t_body
  87  
  88     query =  RDKQuery.n ew('permis sion-sets- edit')
  89     path = q uery.path
  90     p path
  91       @response  = HTTParty RDK.put_as _user(path , " R E D A CTED ; DNS     ", " REDACTED ", content _body.to_j son, { "Co ntent-Type " => "appl ication/js on" })
  92  
  93   end
  94  
  95   Given(/^th e client h as request ed the per mission se t list$/)  do
  96     query =  RDKQuery.n ew('permis sion-sets- list')
  97     path = q uery.path
  98     p path
  99       @response  = HTTParty RDK.get_as _user(path , " R E D A CTED ; DNS     ", " REDACTED ")
  100   end
  101  
  102   DISCHARGE_ PERMISSION _DISCONTIN UE = 'disc ontinue-di scharge-fo llowup'
  103   DISCHARGE_ PERMISSION _EDIT = 'e dit-discha rge-follow up'
  104   DISCHARGE_ PERMISSION _READ = 'r ead-discha rge-follow up'
  105  
  106   Then(/^the  following  sets cont ain permis sions to d iscontinue , edit and  read disc harge foll ow ups$/)  do |table|
  107     discharg e = DISCHA RGE_PERMIS SION_DISCO NTINUE
  108     edit = D ISCHARGE_P ERMISSION_ EDIT
  109     read = D ISCHARGE_P ERMISSION_ READ
  110  
  111     response _json = JS ON.parse(@ response.b ody)
  112     response _array = r esponse_js on['data']
  113     table.ro ws.each do  | permiss ion_set |
  114       found  = false
  115       respon se_array.e ach do | p ermission_ hash |
  116         if p ermission_ hash['val' ].eql? per mission_se t[0]
  117           se t_value =  permission _set[0]
  118           se t = permis sion_hash[ 'permissio ns']
  119  
  120           ex pect(set). to include (discharge ), "Expect ed set #{s et_value}  to include  #{dischar ge}: #{set }"
  121           ex pect(set). to include (edit), "E xpected se t #{set_va lue} to in clude #{ed it}: #{set }"
  122           ex pect(set). to include (read), "E xpected se t #{set_va lue} to in clude #{re ad}: #{set }"
  123           fo und = true
  124           br eak
  125         end
  126       end
  127       expect (found).to  eq(true),  "permissi on set lis t did not  contain pe rmission # {permissio n_set[0]}"
  128     end
  129   end
  130  
  131   Then(/^the  following  sets do n ot contain  permissio ns to disc ontinue, e dit and re ad dischar ge follow  ups$/) do  |table|
  132     discharg e = DISCHA RGE_PERMIS SION_DISCO NTINUE
  133     edit = D ISCHARGE_P ERMISSION_ EDIT
  134     read = D ISCHARGE_P ERMISSION_ READ
  135  
  136     response _json = JS ON.parse(@ response.b ody)
  137     response _array = r esponse_js on['data']
  138     table.ro ws.each do  | permiss ion_set |
  139       found  = false
  140       respon se_array.e ach do | p ermission_ hash |
  141         if p ermission_ hash['val' ].eql? per mission_se t[0]
  142           se t_value =  permission _set[0]
  143           se t = permis sion_hash[ 'permissio ns']
  144  
  145           ex pect(set). to_not inc lude(disch arge), "Ex pected set  #{set_val ue} to not  include # {discharge }: #{set}"
  146           ex pect(set). to_not inc lude(edit) , "Expecte d set #{se t_value} t o not incl ude #{edit }: #{set}"
  147           ex pect(set). to_not inc lude(read) , "Expecte d set #{se t_value} t o not incl ude #{read }: #{set}"
  148           fo und = true
  149           br eak
  150         end
  151       end
  152       expect (found).to  eq(true),  "permissi on set lis t did not  contain pe rmission # {permissio n_set[0]}"
  153     end
  154   end
  155  
  156   Then(/^the  following  sets cont ain only r ead discha rge follow  ups$/) do  |table|
  157     discharg e = DISCHA RGE_PERMIS SION_DISCO NTINUE
  158     edit = D ISCHARGE_P ERMISSION_ EDIT
  159     read = D ISCHARGE_P ERMISSION_ READ
  160  
  161     response _json = JS ON.parse(@ response.b ody)
  162     response _array = r esponse_js on['data']
  163     table.ro ws.each do  | permiss ion_set |
  164       found  = false
  165       respon se_array.e ach do | p ermission_ hash |
  166         if p ermission_ hash['val' ].eql? per mission_se t[0]
  167           se t_value =  permission _set[0]
  168           se t = permis sion_hash[ 'permissio ns']
  169           ex pect(set). to_not inc lude(disch arge), "Ex pected set  #{set_val ue} to not  include # {discharge }: #{set}"
  170           ex pect(set). to_not inc lude(edit) , "Expecte d set #{se t_value} t o not incl ude #{edit }: #{set}"
  171           ex pect(set). to include (read), "E xpected se t #{set_va lue} to in clude #{re ad}: #{set }"
  172           fo und = true
  173           br eak
  174         end
  175       end
  176       expect (found).to  eq(true),  "permissi on set lis t did not  contain pe rmission # {permissio n_set[0]}"
  177     end
  178   end