From 123b8b906cce08a1020c7d960e569cc56cabd349 Mon Sep 17 00:00:00 2001 From: Thorsten Claus Date: Thu, 17 Jun 2021 10:26:39 +0200 Subject: [PATCH 1/2] 8106 set share status in contacts --- lib/archive_importer/contact_importer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/archive_importer/contact_importer.rb b/lib/archive_importer/contact_importer.rb index 492375691..b64dfe7b7 100644 --- a/lib/archive_importer/contact_importer.rb +++ b/lib/archive_importer/contact_importer.rb @@ -34,7 +34,7 @@ class ArchiveImporter def create_contact person = Person.by_account_identifier(json.fetch("account_id")) - user.contacts.create!(person_id: person.id, sharing: false, receiving: json.fetch("receiving")) + user.contacts.create!(person_id: person.id, sharing: json.fetch("sharing"), receiving: json.fetch("receiving")) end end end From 60f9dbcdbd2c8d2217c9496926fd17cd53e2906b Mon Sep 17 00:00:00 2001 From: Thorsten Claus Date: Thu, 17 Jun 2021 11:15:21 +0200 Subject: [PATCH 2/2] Adapted tests for imported share-attribute --- spec/integration/migration_service_spec.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/integration/migration_service_spec.rb b/spec/integration/migration_service_spec.rb index ce2bd47e5..49682527c 100644 --- a/spec/integration/migration_service_spec.rb +++ b/spec/integration/migration_service_spec.rb @@ -287,17 +287,17 @@ describe MigrationService do contact = user.contacts.find_by(person: Person.by_account_identifier(contact1_diaspora_id)) expect(contact).not_to be_nil - expect(contact.sharing).to be_falsey + expect(contact.sharing).to be_truthy expect(contact.receiving).to be_falsey contact = user.contacts.find_by(person: Person.by_account_identifier(contact2_diaspora_id)) expect(contact).not_to be_nil - expect(contact.sharing).to be_falsey + expect(contact.sharing).to be_truthy expect(contact.receiving).to be_truthy contact = user.contacts.find_by(person: Person.by_account_identifier(migrated_contact_new_diaspora_id)) expect(contact).not_to be_nil - expect(contact.sharing).to be_falsey + expect(contact.sharing).to be_truthy expect(contact.receiving).to be_truthy aspect = user.aspects.find_by(name: "Friends")