mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
Fix social media import
This commit is contained in:
@@ -59,7 +59,7 @@ class EnterpriseImporter
|
||||
attributes[media.name.downcase] = media.url
|
||||
end
|
||||
attributes["twitter"] = attributes.delete("x") if attributes.key?("x")
|
||||
enterprise_attributes = attributes.slice(SocialMediaBuilder::NAMES)
|
||||
enterprise_attributes = attributes.slice(*SocialMediaBuilder::NAMES)
|
||||
enterprise.assign_attributes(enterprise_attributes)
|
||||
end
|
||||
|
||||
|
||||
@@ -20,6 +20,13 @@ RSpec.describe EnterpriseImporter do
|
||||
}
|
||||
)
|
||||
],
|
||||
socialMedias: [
|
||||
DataFoodConsortium::Connector::SocialMedia.new(
|
||||
nil,
|
||||
name: "Facebook",
|
||||
url: "dfc_test_farm",
|
||||
)
|
||||
],
|
||||
)
|
||||
}
|
||||
|
||||
@@ -31,6 +38,7 @@ RSpec.describe EnterpriseImporter do
|
||||
expect(enterprise.name).to eq "Test Farm"
|
||||
expect(enterprise.address.state.name).to eq "Victoria"
|
||||
expect(enterprise.address.country.name).to eq "Australia"
|
||||
expect(enterprise.facebook).to eq "dfc_test_farm"
|
||||
end
|
||||
|
||||
it "understands old country names" do
|
||||
|
||||
Reference in New Issue
Block a user