spec/models/scimitar/resources/mixin_spec.rb in scimitar-2.5.0 vs spec/models/scimitar/resources/mixin_spec.rb in scimitar-2.6.0

- old
+ new

@@ -158,17 +158,18 @@ # #to_scim # ========================================================================= context '#to_scim' do context 'with a UUID, renamed primary key column' do - it 'compiles instance attribute values into a SCIM representation' do + it 'compiles instance attribute values into a SCIM representation, but omits do-not-return fields' do uuid = SecureRandom.uuid instance = MockUser.new instance.primary_key = uuid instance.scim_uid = 'AA02984' instance.username = 'foo' + instance.password = 'correcthorsebatterystaple' instance.first_name = 'Foo' instance.last_name = 'Bar' instance.work_email_address = 'foo.bar@test.com' instance.home_email_address = nil instance.work_phone_number = '+642201234567' @@ -402,10 +403,11 @@ shared_examples 'a creator' do | force_upper_case: | context 'which writes instance attribute values from a SCIM representation while' do it 'ignoring read-only lists' do hash = { 'userName' => 'foo', + 'password' => 'staplebatteryhorsecorrect', 'name' => {'givenName' => 'Foo', 'familyName' => 'Bar'}, 'active' => true, 'emails' => [{'type' => 'work', 'primary' => true, 'value' => 'foo.bar@test.com'}], 'phoneNumbers' => [{'type' => 'work', 'primary' => false, 'value' => '+642201234567' }], 'groups' => [{'type' => 'Group', 'value' => '1'}, {'type' => 'Group', 'value' => '2'}], @@ -426,9 +428,10 @@ instance.home_email_address = 'home@test.com' # Should be cleared as no home e-mail specified in SCIM hash above instance.from_scim!(scim_hash: hash) expect(instance.scim_uid ).to eql('AA02984') expect(instance.username ).to eql('foo') + expect(instance.password ).to eql('staplebatteryhorsecorrect') expect(instance.first_name ).to eql('Foo') expect(instance.last_name ).to eql('Bar') expect(instance.work_email_address).to eql('foo.bar@test.com') expect(instance.home_email_address).to be_nil expect(instance.work_phone_number ).to eql('+642201234567')