Commit 31686d8c8fe8cf372a4cc2d775604f906516a24b
1 parent
9ea545f1
Exists in
master
and in
28 other branches
ActionItem466: "fixing" tests
with a children count cache we have to reload ojects before asking for their children git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2061 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
5 additions
and
0 deletions
Show diff stats
test/unit/category_finder_test.rb
... | ... | @@ -90,6 +90,8 @@ class CategoryFinderTest < ActiveSupport::TestCase |
90 | 90 | c4 = Category.create!(:name => 'child 2', :environment => Environment.default, :parent => c1) |
91 | 91 | c5 = Category.create!(:name => 'grandchild 2', :environment => Environment.default, :parent => c4) |
92 | 92 | |
93 | + c1.reload | |
94 | + | |
93 | 95 | assert_equivalent [c1,c2,c3,c4,c5].map(&:id), CategoryFinder.new(c1).category_ids |
94 | 96 | end |
95 | 97 | |
... | ... | @@ -98,6 +100,8 @@ class CategoryFinderTest < ActiveSupport::TestCase |
98 | 100 | child = Category.create!(:name => 'child category', :environment => Environment.default, :parent => parent) |
99 | 101 | p1 = create_user('people_1').person; p1.name = 'a beautiful person'; p1.categories << child; p1.save! |
100 | 102 | |
103 | + parent.reload | |
104 | + | |
101 | 105 | f = CategoryFinder.new(parent) |
102 | 106 | assert_includes f.find(:people, 'beautiful'), p1 |
103 | 107 | end | ... | ... |
test/unit/rss_feed_test.rb
... | ... | @@ -90,6 +90,7 @@ class RssFeedTest < Test::Unit::TestCase |
90 | 90 | a3_2 = a3.children.build(:name => 'article 3.2', :parent => a3, :profile => profile); a3_2.save! |
91 | 91 | a3_2_1 = a3_2.children.build(:name => 'article 3.2.1', :parent => a3_2, :profile => profile); a3_2_1.save! |
92 | 92 | |
93 | + a3.reload | |
93 | 94 | feed = RssFeed.new(:name => 'testfeed') |
94 | 95 | feed.parent = a3 |
95 | 96 | feed.profile = profile | ... | ... |