diff --git a/lib/archive_importer.rb b/lib/archive_importer.rb index 67ba34a97..d2310437c 100644 --- a/lib/archive_importer.rb +++ b/lib/archive_importer.rb @@ -42,7 +42,7 @@ class ArchiveImporter attr_reader :archive_hash def profile_attributes - allowed_keys = %w[first_name last_name image_url bio searchable nsfw tag_string] + allowed_keys = %w[first_name last_name image_url bio gender location birthday searchable nsfw tag_string] profile_data = archive_hash["user"]["profile"]["entity_data"] convert_keys(profile_data, allowed_keys).tap do |attrs| attrs[:public_details] = profile_data["public"] diff --git a/spec/lib/archive_importer_spec.rb b/spec/lib/archive_importer_spec.rb index fafe04232..72f0db21e 100644 --- a/spec/lib/archive_importer_spec.rb +++ b/spec/lib/archive_importer_spec.rb @@ -125,6 +125,9 @@ describe ArchiveImporter do "full_name" => "Full Name", "image_url" => "https://example.com/my_avatar.png", "bio" => "I'm just a test account", + "gender" => "Robot", + "birthday" => "2006-01-01", + "location" => "diaspora* specs", "searchable" => false, "public" => true, "nsfw" => true, @@ -157,6 +160,9 @@ describe ArchiveImporter do expect(archive_importer.user.profile.last_name).to eq("Last") expect(archive_importer.user.profile.image_url).to eq("https://example.com/my_avatar.png") expect(archive_importer.user.profile.bio).to eq("I'm just a test account") + expect(archive_importer.user.profile.gender).to eq("Robot") + expect(archive_importer.user.profile.birthday).to eq(Date.new(2006, 1, 1)) + expect(archive_importer.user.profile.location).to eq("diaspora* specs") expect(archive_importer.user.profile.searchable).to eq(false) expect(archive_importer.user.profile.public_details).to eq(true) expect(archive_importer.user.profile.nsfw).to eq(true)