Fix AS::Photo federation, hopefully
This commit is contained in:
parent
6a88abb6dd
commit
d22878f3f0
3 changed files with 18 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
class ActivityStreams::Photo < Post
|
||||
include Diaspora::Socketable
|
||||
|
||||
xml_name "activity_streams::_photo"
|
||||
xml_attr :image_url
|
||||
xml_attr :image_height
|
||||
xml_attr :image_width
|
||||
|
|
|
|||
|
|
@ -104,3 +104,12 @@ Factory.define(:notification) do |n|
|
|||
end
|
||||
end
|
||||
|
||||
Factory.define(:activity_streams_photo, :class => ActivityStreams::Photo) do |p|
|
||||
p.association(:author, :factory => :person)
|
||||
p.image_url "http://example.com/awesome.png"
|
||||
p.image_height 9001
|
||||
p.image_width 4
|
||||
p.object_url "http://example.com/awesome_things.html"
|
||||
p.actor_url "http://notcubbi.es/cubber"
|
||||
p.provider_display_name "not cubbies"
|
||||
end
|
||||
|
|
|
|||
|
|
@ -25,4 +25,12 @@ JSON
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
describe 'serialization' do
|
||||
it 'Diaspora::Parser should pick the right class' do
|
||||
photo = Factory(:activity_streams_photo)
|
||||
xml = photo.to_diaspora_xml.to_s
|
||||
Diaspora::Parser.from_xml(xml).class.should == ActivityStreams::Photo
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue