make URL clickable in RSS #2176
This commit is contained in:
parent
731446e078
commit
9fdca1adf8
2 changed files with 11 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ atom_feed({'xmlns:thr' => 'http://purl.org/syndication/thread/1.0',
|
|||
:id => "#{@user.person.url}p/#{post.id}" do |entry|
|
||||
|
||||
entry.title truncate(post.formatted_message(:plain_text => true), :length => 50)
|
||||
entry.content post.formatted_message(:plain_text => true), :type => 'html'
|
||||
entry.content auto_link(post.formatted_message(:plain_text => true)), :type => 'html'
|
||||
entry.tag! 'activity:verb', 'http://activitystrea.ms/schema/1.0/post'
|
||||
entry.tag! 'activity:object-type', 'http://activitystrea.ms/schema/1.0/note'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -46,6 +46,16 @@ describe UsersController do
|
|||
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|
|
||||
p.text = "Goto http://diasporaproject.org/ now!"
|
||||
p.save
|
||||
end
|
||||
get :public, :username => @user.username, :format => :atom
|
||||
response.body.should include('<a href="http://diasporaproject.org/">http://diasporaproject.org/</a>')
|
||||
end
|
||||
|
||||
it 'redirects to a profile page if html is requested' do
|
||||
get :public, :username => @user.username
|
||||
response.should be_redirect
|
||||
|
|
|
|||
Loading…
Reference in a new issue