Commit 0a4543de0f65f6a207dc3405f28dcaf722462a6f
1 parent
b443571b
Exists in
master
and in
28 other branches
ActionItem23: limiting the number of articles
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1122 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
16 additions
and
2 deletions
Show diff stats
app/models/rss_feed.rb
test/unit/rss_feed_test.rb
... | ... | @@ -107,7 +107,21 @@ class RssFeedTest < Test::Unit::TestCase |
107 | 107 | end |
108 | 108 | |
109 | 109 | should 'be able to indicate maximum number of items' do |
110 | - flunk 'pending' | |
110 | + profile = create_user('testuser').person | |
111 | + a1 = profile.articles.build(:name => 'article 1'); a1.save! | |
112 | + a2 = profile.articles.build(:name => 'article 2'); a2.save! | |
113 | + a3 = profile.articles.build(:name => 'article 3'); a3.save! | |
114 | + | |
115 | + feed = RssFeed.new(:name => 'feed') | |
116 | + feed.profile = profile | |
117 | + feed.save! | |
118 | + | |
119 | + feed.profile.expects(:recent_documents).with(10).returns([]).once | |
120 | + feed.data | |
121 | + | |
122 | + feed.settings[:limit] = 5 | |
123 | + feed.profile.expects(:recent_documents).with(5).returns([]).once | |
124 | + feed.data | |
111 | 125 | end |
112 | 126 | |
113 | 127 | end | ... | ... |