Commit eb17fc65a45b16fec2dd75e634efa7ac3f349a3b

Authored by Leandro Nunes dos Santos
Committed by Rodrigo Souto
1 parent 78fffbce

The comments are not loadded by default on the wall anymore

Showing 1 changed file with 16 additions and 5 deletions   Show diff stats
test/functional/profile_controller_test.rb
@@ -1383,17 +1383,21 @@ class ProfileControllerTest < ActionController::TestCase @@ -1383,17 +1383,21 @@ class ProfileControllerTest < ActionController::TestCase
1383 assert_equal "Comment successfully added.", assigns(:message) 1383 assert_equal "Comment successfully added.", assigns(:message)
1384 end 1384 end
1385 1385
1386 - should 'display comment in wall if user was removed' do 1386 + should 'display comment in wall if user was removed after click in view all comments' do
1387 UserStampSweeper.any_instance.stubs(:current_user).returns(profile) 1387 UserStampSweeper.any_instance.stubs(:current_user).returns(profile)
1388 article = TinyMceArticle.create!(:profile => profile, :name => 'An article about free software') 1388 article = TinyMceArticle.create!(:profile => profile, :name => 'An article about free software')
1389 to_be_removed = create_user('removed_user').person 1389 to_be_removed = create_user('removed_user').person
1390 comment = Comment.create!(:author => to_be_removed, :title => 'Test Comment', :body => 'My author does not exist =(', :source_id => article.id, :source_type => 'Article') 1390 comment = Comment.create!(:author => to_be_removed, :title => 'Test Comment', :body => 'My author does not exist =(', :source_id => article.id, :source_type => 'Article')
1391 to_be_removed.destroy 1391 to_be_removed.destroy
1392 1392
  1393 + activity = ActionTracker::Record.last
  1394 +
1393 login_as(profile.identifier) 1395 login_as(profile.identifier)
1394 - get :index, :profile => profile.identifier 1396 + get :more_comments, :profile => profile.identifier, :activity => activity.id, :comment_page => 1, :tab_action => 'wall'
1395 1397
1396 - assert_tag :tag => 'span', :content => '(removed user)', :attributes => {:class => 'comment-user-status comment-user-status-wall icon-user-removed'} 1398 + assert_select_rjs :insert_html do
  1399 + assert_select 'span', :content => '(removed user)', :attributes => {:class => 'comment-user-status comment-user-status-wall icon-user-removed'}
  1400 + end
1397 end 1401 end
1398 1402
1399 should 'not display spam comments in wall' do 1403 should 'not display spam comments in wall' do
@@ -1407,7 +1411,7 @@ class ProfileControllerTest < ActionController::TestCase @@ -1407,7 +1411,7 @@ class ProfileControllerTest < ActionController::TestCase
1407 assert !/This article makes me hungry/.match(@response.body), 'Spam comment was shown!' 1411 assert !/This article makes me hungry/.match(@response.body), 'Spam comment was shown!'
1408 end 1412 end
1409 1413
1410 - should 'display comment in wall from non logged users' do 1414 + should 'display comment in wall from non logged users after click in view all comments' do
1411 UserStampSweeper.any_instance.stubs(:current_user).returns(profile) 1415 UserStampSweeper.any_instance.stubs(:current_user).returns(profile)
1412 article = TinyMceArticle.create!(:profile => profile, :name => 'An article about free software') 1416 article = TinyMceArticle.create!(:profile => profile, :name => 'An article about free software')
1413 comment = Comment.create!(:name => 'outside user', :email => 'outside@localhost.localdomain', :title => 'Test Comment', :body => 'My author does not exist =(', :source_id => article.id, :source_type => 'Article') 1417 comment = Comment.create!(:name => 'outside user', :email => 'outside@localhost.localdomain', :title => 'Test Comment', :body => 'My author does not exist =(', :source_id => article.id, :source_type => 'Article')
@@ -1415,7 +1419,14 @@ class ProfileControllerTest < ActionController::TestCase @@ -1415,7 +1419,14 @@ class ProfileControllerTest < ActionController::TestCase
1415 login_as(profile.identifier) 1419 login_as(profile.identifier)
1416 get :index, :profile => profile.identifier 1420 get :index, :profile => profile.identifier
1417 1421
1418 - assert_tag :tag => 'span', :content => '(unauthenticated user)', :attributes => {:class => 'comment-user-status comment-user-status-wall icon-user-unknown'} 1422 + activity = ActionTracker::Record.last
  1423 +
  1424 + login_as(profile.identifier)
  1425 + get :more_comments, :profile => profile.identifier, :activity => activity.id, :comment_page => 1, :tab_action => 'wall'
  1426 +
  1427 + assert_select_rjs :insert_html do
  1428 + assert_select 'span', :content => '(unauthenticated user)', :attributes => {:class => 'comment-user-status comment-user-status-wall icon-user-unknown'}
  1429 + end
1419 end 1430 end
1420 1431
1421 should 'add locale on mailing' do 1432 should 'add locale on mailing' do