Skip to content

Commit

Permalink
make URL clickable in RSS #2176
Browse files Browse the repository at this point in the history
  • Loading branch information
Diaspora Europe committed Mar 29, 2012
1 parent 731446e commit 9fdca1a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/users/public.atom.builder
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions spec/controllers/users_controller_spec.rb
Expand Up @@ -45,6 +45,16 @@
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|
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
Expand Down

0 comments on commit 9fdca1a

Please sign in to comment.