spec/models/scimitar/resources/mixin_spec.rb in scimitar-1.3.0 vs spec/models/scimitar/resources/mixin_spec.rb in scimitar-1.3.1

- old
+ new

@@ -1745,9 +1745,27 @@ expect(scim_hash['emails'].size).to eql(1) expect(scim_hash['emails'][0]['type' ]).to eql('work') expect(scim_hash['emails'][0]['value']).to eql('work@test.com') end + + context 'when prior value already exists, and no path' do + it 'simple value: overwrites' do + path = [ 'root' ] + scim_hash = { 'root' => { 'userName' => 'bar', 'active' => true } }.with_indifferent_case_insensitive_access() + + @instance.send( + :from_patch_backend!, + nature: 'replace', + path: path, + value: { 'active' => false }.with_indifferent_case_insensitive_access(), + altering_hash: scim_hash + ) + + expect(scim_hash['root']['userName']).to eql('bar') + expect(scim_hash['root']['active']).to eql(false) + end + end end # context 'when value is not present' do end # "context 'replace' do" # ------------------------------------------------------------------- # Internal: #from_patch_backend - some bespoke complex cases