Commit 514174be70ab846259d0999114eafe2f502089a6
1 parent
445e5140
Exists in
master
and in
29 other branches
ActionItem1067: fixing tests
Showing
6 changed files
with
14 additions
and
5 deletions
Show diff stats
test/functional/profile_controller_test.rb
... | ... | @@ -258,6 +258,7 @@ class ProfileControllerTest < Test::Unit::TestCase |
258 | 258 | login_as(@profile.identifier) |
259 | 259 | friend = create_user('friendtestuser').person |
260 | 260 | @profile.add_friend(friend) |
261 | + @profile.friends.reload | |
261 | 262 | assert @profile.is_a_friend?(friend) |
262 | 263 | get :index, :profile => friend.identifier |
263 | 264 | assert_no_tag :tag => 'a', :content => 'Add friend' | ... | ... |
test/unit/add_friend_test.rb
... | ... | @@ -15,6 +15,8 @@ class AddFriendTest < ActiveSupport::TestCase |
15 | 15 | assert_difference Friendship, :count, 2 do |
16 | 16 | task.finish |
17 | 17 | end |
18 | + p1.friends.reload | |
19 | + p2.friends.reload | |
18 | 20 | |
19 | 21 | ok('p1 should have p2 as friend') { p1.friends.include?(p2) } |
20 | 22 | ok('p2 should have p1 as friend') { p2.friends.include?(p1) } | ... | ... |
test/unit/blog_helper_test.rb
... | ... | @@ -20,7 +20,7 @@ class BlogHelperTest < Test::Unit::TestCase |
20 | 20 | blog.children << published_post = TextileArticle.create!(:name => 'Post', :profile => profile, :parent => blog, :published => true) |
21 | 21 | |
22 | 22 | expects(:display_post).with(anything).returns('POST') |
23 | - expects(:content_tag).with('div', 'POST', :class => 'blog-post position-1 first last', :id => "post-#{published_post.id}").returns('RESULT') | |
23 | + expects(:content_tag).with('div', "POST<br style=\"clear:both\"/>", :class => 'blog-post position-1 first last', :id => "post-#{published_post.id}").returns('RESULT') | |
24 | 24 | |
25 | 25 | assert_equal 'RESULT', list_posts(profile, blog.posts) |
26 | 26 | end |
... | ... | @@ -29,7 +29,7 @@ class BlogHelperTest < Test::Unit::TestCase |
29 | 29 | blog.children << unpublished_post = TextileArticle.create!(:name => 'Post', :profile => profile, :parent => blog, :published => false) |
30 | 30 | |
31 | 31 | expects(:display_post).with(anything).returns('POST') |
32 | - expects(:content_tag).with('div', 'POST', :class => 'blog-post position-1 first last not-published', :id => "post-#{unpublished_post.id}").returns('RESULT') | |
32 | + expects(:content_tag).with('div', "POST<br style=\"clear:both\"/>", :class => 'blog-post position-1 first last not-published', :id => "post-#{unpublished_post.id}").returns('RESULT') | |
33 | 33 | |
34 | 34 | assert_equal 'RESULT', list_posts(profile, blog.posts) |
35 | 35 | end |
... | ... | @@ -40,8 +40,8 @@ class BlogHelperTest < Test::Unit::TestCase |
40 | 40 | blog.children << published_post = TextileArticle.create!(:name => 'Second post', :profile => profile, :parent => blog, :published => true) |
41 | 41 | |
42 | 42 | expects(:display_post).with(anything).returns('POST') |
43 | - expects(:content_tag).with('div', 'POST', has_entries(:id => "post-#{published_post.id}")).returns('RESULT') | |
44 | - expects(:content_tag).with('div', 'POST', has_entries(:id => "post-#{unpublished_post.id}")).never | |
43 | + expects(:content_tag).with('div', "POST<br style=\"clear:both\"/>", has_entries(:id => "post-#{published_post.id}")).returns('RESULT') | |
44 | + expects(:content_tag).with('div', "POST<br style=\"clear:both\"/>", has_entries(:id => "post-#{unpublished_post.id}")).never | |
45 | 45 | |
46 | 46 | assert_equal 'RESULT', list_posts(nil, blog.posts) |
47 | 47 | end | ... | ... |
test/unit/friends_block_test.rb
test/unit/invite_friend_test.rb
... | ... | @@ -16,6 +16,9 @@ class InviteFriendTest < ActiveSupport::TestCase |
16 | 16 | task.finish |
17 | 17 | end |
18 | 18 | |
19 | + p1.friends.reload | |
20 | + p2.friends.reload | |
21 | + | |
19 | 22 | ok('p1 should have p2 as friend') { p1.friends.include?(p2) } |
20 | 23 | ok('p2 should have p1 as friend') { p2.friends.include?(p1) } |
21 | 24 | end | ... | ... |
test/unit/person_test.rb
... | ... | @@ -194,6 +194,7 @@ class PersonTest < Test::Unit::TestCase |
194 | 194 | |
195 | 195 | p1.add_friend(p2) |
196 | 196 | |
197 | + p1.friends.reload | |
197 | 198 | assert_equal [p2], p1.friends |
198 | 199 | |
199 | 200 | p3 = create_user('testuser3').person |
... | ... | @@ -344,7 +345,7 @@ class PersonTest < Test::Unit::TestCase |
344 | 345 | person.save! |
345 | 346 | friend = create_user('test_friend').person |
346 | 347 | person.add_friend(friend) |
347 | - | |
348 | + person.friends.reload | |
348 | 349 | assert person.display_info_to?(friend) |
349 | 350 | end |
350 | 351 | |
... | ... | @@ -500,6 +501,7 @@ class PersonTest < Test::Unit::TestCase |
500 | 501 | p1 = create_user('testuser1').person |
501 | 502 | p2 = create_user('testuser2').person |
502 | 503 | p1.add_friend(p2) |
504 | + p1.friends.reload | |
503 | 505 | assert p1.is_a_friend?(p2) |
504 | 506 | end |
505 | 507 | ... | ... |