diff --git a/app/models/person.rb b/app/models/person.rb index 8a06ca688e7a3c533971ea0deeb4ef18b0b02616..7ace2308da46db0948d2e3e06d194c70b037ead2 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -4,14 +4,15 @@ class Person xml_accessor :email xml_accessor :url - xml_accessor :profile, :as => Profile xml_accessor :_id xml_accessor :key_fingerprint + xml_accessor :profile, :as => Profile + key :email, String key :url, String key :active, Boolean, :default => false - key :key_fingerprint, String, :default => "" + key :key_fingerprint, String one :profile, :class_name => 'Profile', :foreign_key => :person_id many :posts, :class_name => 'Post', :foreign_key => :person_id diff --git a/gpg/diaspora-test/random_seed b/gpg/diaspora-test/random_seed index 3662498f087ad7b8c9e7148f3cbd05527aa1322a..493229c8d4e6a7f7c601cc1effdbcbb6d4de23c1 100644 Binary files a/gpg/diaspora-test/random_seed and b/gpg/diaspora-test/random_seed differ diff --git a/spec/user_encryption_spec.rb b/spec/user_encryption_spec.rb index 3d0a2668529f11db61a2c3a94c77b9b0fc69387d..574a78592577b5e287c7cb66406de8fe8a4b2749 100644 --- a/spec/user_encryption_spec.rb +++ b/spec/user_encryption_spec.rb @@ -37,17 +37,22 @@ describe 'user encryption' do it 'should receive and marshal a public key from a request' do person = Factory.build(:person, :url => "http://test.url/" ) + person.key_fingerprint.nil?.should== false + #should move this to friend request, but i found it here + f = person.key_fingerprint + id = person.id original_key = person.export_key request = Request.instantiate(:to =>"http://www.google.com/", :from => person) xml = Request.build_xml_for [request] - puts xml - person.destroy store_objects_from_xml(xml) - + Person.all.count.should == 2 new_person = Person.first(:url => "http://test.url/") + new_person.key_fingerprint.nil?.should == false + new_person.id.should == id + new_person.key_fingerprint.should == f new_person.export_key.should == original_key end end