diff --git a/app/views/profile/_comment.rhtml b/app/views/profile/_comment.rhtml index 8b40ba5..c5f40f4 100644 --- a/app/views/profile/_comment.rhtml +++ b/app/views/profile/_comment.rhtml @@ -5,19 +5,35 @@
<% end %> diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 85bf012..5c6c5e9 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1094,6 +1094,10 @@ a.comment-picture { left: 33px; background-repeat: no-repeat; } +.comment-user-status-wall { + top: 16px; + left: 16px; +} #article .article-comments-list, #article .article-comments-list ul, #article .article-comments-list li { padding: 0; margin: 0; diff --git a/test/functional/profile_controller_test.rb b/test/functional/profile_controller_test.rb index 74a635a..196d760 100644 --- a/test/functional/profile_controller_test.rb +++ b/test/functional/profile_controller_test.rb @@ -1300,4 +1300,28 @@ class ProfileControllerTest < ActionController::TestCase assert_response :success assert_equal "Comment successfully added.", assigns(:message) end + + should 'display comment in wall if user was removed' do + UserStampSweeper.any_instance.stubs(:current_user).returns(profile) + article = TinyMceArticle.create!(:profile => profile, :name => 'An article about free software') + to_be_removed = create_user('removed_user').person + comment = Comment.create!(:author => to_be_removed, :title => 'Test Comment', :body => 'My author does not exist =(', :source_id => article.id, :source_type => 'Article') + to_be_removed.destroy + + login_as(profile.identifier) + get :index, :profile => profile.identifier + + assert_tag :tag => 'span', :content => '(removed user)', :attributes => {:class => 'comment-user-status comment-user-status-wall icon-user-removed'} + end + + should 'display comment in wall from non logged users' do + UserStampSweeper.any_instance.stubs(:current_user).returns(profile) + article = TinyMceArticle.create!(:profile => profile, :name => 'An article about free software') + 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') + + login_as(profile.identifier) + get :index, :profile => profile.identifier + + assert_tag :tag => 'span', :content => '(unauthenticated user)', :attributes => {:class => 'comment-user-status comment-user-status-wall icon-user-unknown'} + end end -- libgit2 0.21.2