profile tagging now federates #FO #REAL
This commit is contained in:
parent
3f026d18eb
commit
924dc13adc
3 changed files with 28 additions and 1 deletions
|
|
@ -49,7 +49,7 @@ class Profile < ActiveRecord::Base
|
||||||
|
|
||||||
def receive(user, person)
|
def receive(user, person)
|
||||||
Rails.logger.info("event=receive payload_type=profile sender=#{person} to=#{user}")
|
Rails.logger.info("event=receive payload_type=profile sender=#{person} to=#{user}")
|
||||||
person.profile.update_attributes self.attributes
|
person.profile.update_attributes self.attributes.merge(:tag_string => self.tag_string)
|
||||||
|
|
||||||
person.profile
|
person.profile
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -136,6 +136,19 @@ describe 'a user receives a post' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe 'profiles' do
|
||||||
|
it 'federates tags' do
|
||||||
|
luke, leia, raph = set_up_friends
|
||||||
|
raph.profile.diaspora_handle = "raph@remote.net"
|
||||||
|
raph.profile.save!
|
||||||
|
p = raph.profile
|
||||||
|
|
||||||
|
p.tag_string = "#big #rafi #style"
|
||||||
|
p.receive(luke, raph)
|
||||||
|
p.tags(true).count.should == 3
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe 'post refs' do
|
describe 'post refs' do
|
||||||
before do
|
before do
|
||||||
@status_message = @user2.post :status_message, :text => "hi", :to => @aspect2.id
|
@status_message = @user2.post :status_message, :text => "hi", :to => @aspect2.id
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,20 @@ describe Profile do
|
||||||
@profile.image_url.should == "http://not/a/relative/url"
|
@profile.image_url.should == "http://not/a/relative/url"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#from_xml' do
|
||||||
|
it 'should make a valid profile object' do
|
||||||
|
|
||||||
|
@profile = Factory.build(:profile)
|
||||||
|
@profile.tag_string = '#big #rafi #style'
|
||||||
|
xml = @profile.to_xml
|
||||||
|
|
||||||
|
new_profile = Profile.from_xml(xml.to_s)
|
||||||
|
new_profile.tag_string.should_not be_blank
|
||||||
|
new_profile.tag_string.should include('#rafi')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe 'serialization' do
|
describe 'serialization' do
|
||||||
let(:person) {Factory.create(:person,:diaspora_handle => "foobar" )}
|
let(:person) {Factory.create(:person,:diaspora_handle => "foobar" )}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue