spec/lib/contentful/management/entry_spec.rb in contentful-management-0.3.0 vs spec/lib/contentful/management/entry_spec.rb in contentful-management-0.3.1
- old
+ new
@@ -602,9 +602,18 @@
expect(parsed_attributes[:entry]).to match('en-US' => {sys: {type: 'Link', linkType: 'Entry', id: nil}})
expect(parsed_attributes[:entries]).to match('en-US' => [{sys: {type: 'Link', linkType: 'Entry', id: nil}}, {sys: {type: 'Link', linkType: 'Entry', id: nil}}])
end
+ it 'keepd hashes in attributes' do
+ attributes = {
+ entries: [{sys: {type: 'Link', linkType: 'Entry', id: nil}}, {sys: {type: 'Link', linkType: 'Entry', id: nil}}]
+ }
+
+ parsed_attributes = Entry.new.fields_from_attributes(attributes)
+
+ expect(parsed_attributes[:entries]).to match('en-US' => [{sys: {type: 'Link', linkType: 'Entry', id: nil}}, {sys: {type: 'Link', linkType: 'Entry', id: nil}}])
+ end
end
end
end
end