spec/happymapper_spec.rb in lightningdb-happymapper-0.3.1 vs spec/happymapper_spec.rb in lightningdb-happymapper-0.3.2
- old
+ new
@@ -33,16 +33,30 @@
has_one :feature_bullets, FeatureBullet
has_one :address, Address
end
module FamilySearch
+ class AlternateIds
+ include HappyMapper
+
+ tag 'alternateIds'
+ has_many :ids, String, :tag => 'id'
+ end
+
+ class Information
+ include HappyMapper
+
+ has_one :alternateIds, AlternateIds
+ end
+
class Person
include HappyMapper
attribute :version, String
attribute :modified, Time
attribute :id, String
+ has_one :information, Information
end
class Persons
include HappyMapper
has_many :person, Person
@@ -540,16 +554,18 @@
last_event.address.state.should == 'FL'
last_event.address.zip.should == '327506398'
track.tran_detail.cust_tran_id.should == '20090102-111321'
end
- xit "should parse family search xml" do
+ it "should parse family search xml" do
tree = FamilySearch::FamilyTree.parse(fixture_file('family_tree.xml'))
tree.version.should == '1.0.20071213.942'
tree.status_message.should == 'OK'
tree.status_code.should == '200'
- # tree.people.size.should == 1
- # tree.people.first.version.should == '1199378491000'
- # tree.people.first.modified.should == Time.utc(2008, 1, 3, 16, 41, 31) # 2008-01-03T09:41:31-07:00
- # tree.people.first.id.should == 'KWQS-BBQ'
+ tree.persons.person.size.should == 1
+ tree.persons.person.first.version.should == '1199378491000'
+ tree.persons.person.first.modified.should == Time.utc(2008, 1, 3, 16, 41, 31) # 2008-01-03T09:41:31-07:00
+ tree.persons.person.first.id.should == 'KWQS-BBQ'
+ tree.persons.person.first.information.alternateIds.ids.should_not be_kind_of(String)
+ tree.persons.person.first.information.alternateIds.ids.size.should == 8
end
end