Commit 2059ca6a0c102144cd80c26891d8ba5bfeba1fca

Authored by AntonioTerceiro
1 parent 22081f3e

ActionItem23: linking to articles



git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1145 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/models/rss_feed.rb
... ... @@ -84,8 +84,8 @@ class RssFeed < Article
84 84 # rfc822
85 85 xml.pubDate(article.created_on.rfc2822)
86 86 # FIXME link to article
87   - xml.link("http://www.yourDomain.com/linkToYourPost")
88   - xml.guid("http://www.yourDomain.com/linkToYourPost")
  87 + xml.link(article.url)
  88 + xml.guid(article.url)
89 89 end
90 90 end
91 91 end
... ...
test/unit/rss_feed_test.rb
... ... @@ -116,7 +116,15 @@ class RssFeedTest < Test::Unit::TestCase
116 116 end
117 117  
118 118 should 'provide link to each article' do
119   - flunk 'pending'
  119 + profile = create_user('testuser').person
  120 + art = profile.articles.build(:name => 'myarticle'); art.save!
  121 + feed = RssFeed.new(:name => 'feed')
  122 + feed.profile = profile
  123 + feed.save!
  124 +
  125 + data = feed.data
  126 + assert_match "<link>#{art.url}</link>", data
  127 + assert_match "<guid>#{art.url}</guid>", data
120 128 end
121 129  
122 130 should 'be able to indicate maximum number of items' do
... ...