Commit 90f24f9a69d987de1a907430c2e9eff93b309653
1 parent
285463b5
Exists in
master
and in
29 other branches
ActionItem573: listing most recent first
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2294 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
4 additions
and
5 deletions
Show diff stats
app/models/category_finder.rb
test/unit/category_finder_test.rb
... | ... | @@ -163,13 +163,12 @@ class CategoryFinderTest < ActiveSupport::TestCase |
163 | 163 | |
164 | 164 | should 'list recent articles' do |
165 | 165 | person = create_user('teste').person |
166 | - art1 = person.articles.build(:name => 'an article to be found'); art1.add_category(@category); art1.save! | |
167 | - | |
168 | - art2 = person.articles.build(:name => 'another article to be found'); art2.add_category(@category); art2.save! | |
166 | + art1 = person.articles.create!(:name => 'an article to be found', :category_ids => [@category.id]) | |
167 | + art2 = person.articles.create!(:name => 'another article to be found', :category_ids => [@category.id]) | |
169 | 168 | |
170 | 169 | result = @finder.recent('articles', 1) |
171 | 170 | |
172 | - assert_equal 1, result.size | |
171 | + assert_equal [art2], result | |
173 | 172 | end |
174 | 173 | |
175 | 174 | should 'not return the same result twice' do | ... | ... |