Skip to content
Extraits de code Groupes Projets
Valider d9d7bbb7 rédigé par Florian Staudacher's avatar Florian Staudacher
Parcourir les fichiers

using timecop for interactions + whitespaces removed

parent d328cdaa
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
atom_feed({'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
'xmlns:georss' => 'http://www.georss.org/georss',
'xmlns:activity' => 'http://activitystrea.ms/spec/1.0/',
'xmlns:georss' => 'http://www.georss.org/georss',
'xmlns:activity' => 'http://activitystrea.ms/spec/1.0/',
'xmlns:media' => 'http://purl.org/syndication/atommedia',
'xmlns:poco' => 'http://portablecontacts.net/spec/1.0',
'xmlns:ostatus' => 'http://ostatus.org/schema/1.0',
'xmlns:poco' => 'http://portablecontacts.net/spec/1.0',
'xmlns:ostatus' => 'http://ostatus.org/schema/1.0',
'xmlns:statusnet' => 'http://status.net/schema/api/1/',
:id => "#{@user.public_url}.atom",
:root_url => "#{@user.public_url}"}) do |feed|
......@@ -14,13 +14,13 @@ atom_feed({'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
feed.logo "#{@user.person.profile.image_url(:thumb_small)}"
feed.updated @posts[0].created_at if @posts.length > 0
feed.tag! :link, :rel => 'avatar', :type => 'image/jpeg', 'media:width' => '100',
'media:height' => '100', :href => "#{@user.profile.image_url}"
'media:height' => '100', :href => "#{@user.profile.image_url}"
feed.tag! :link, :href => "#{AppConfig[:pubsub_server]}", :rel => 'hub'
feed.author do |author|
author.name @user.name
author.uri local_or_remote_person_path(@user.person, :absolute => true)
author.tag! 'activity:object-type', 'http://activitystrea.ms/schema/1.0/person'
author.tag! 'poco:preferredUsername', @user.username
author.tag! 'poco:displayName', @user.person.name
......@@ -36,5 +36,5 @@ atom_feed({'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
entry.tag! 'activity:verb', 'http://activitystrea.ms/schema/1.0/post'
entry.tag! 'activity:object-type', 'http://activitystrea.ms/schema/1.0/note'
end
end
end
end
......@@ -36,7 +36,7 @@ describe UsersController do
it 'should 404 if no user is found' do
get :user_photo, :username => 'none'
response.should_not be_success
end
end
end
describe '#public' do
......@@ -45,7 +45,7 @@ describe UsersController do
get :public, :username => @user.username, :format => :atom
response.body.should include(sm.text)
end
it 'renders xml if atom is requested with clickalbe urls' do
sm = Factory(:status_message, :public => true, :author => @user.person)
@user.person.posts.each do |p|
......
......@@ -9,10 +9,12 @@ describe Diaspora::Relayable do
describe 'interacted_at' do
it 'sets the interacted at of the parent to the created at of the relayable post' do
relayable = build_object
relayable.save
if relayable.parent.respond_to?(:interacted_at) #I'm sorry.
relayable.parent.interacted_at.to_i.should == relayable.created_at.to_i
Timecop.freeze do
relayable = build_object
relayable.save
if relayable.parent.respond_to?(:interacted_at) #I'm sorry.
relayable.parent.interacted_at.to_i.should == relayable.created_at.to_i
end
end
end
end
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter