diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 73e593f63..808566d0c 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -20,14 +20,4 @@ class CommentsController < ApplicationController end end - def destroy - target = Comment.where(:diaspora_handle => current_user.diaspora_handle, :id => params[:id]).first - - if target - target.destroy - end - - render :nothing => true - end - end diff --git a/app/views/comments/_comment.html.haml b/app/views/comments/_comment.html.haml index 662db1966..f84d4b6d5 100644 --- a/app/views/comments/_comment.html.haml +++ b/app/views/comments/_comment.html.haml @@ -8,8 +8,5 @@ .from = link_to post.person.real_name, post.person = markdownify(post.text) - - if current_user.owns?(post) - .right - = link_to t('delete'), comment_path(post), :confirm => t('are_you_sure'), :method => :delete, :remote => true, :class => "delete" %div.time = "#{time_ago_in_words(post.updated_at)} #{t('ago')}" diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index b1d84cdd1..a6d95a536 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -57,27 +57,4 @@ describe CommentsController do end end end - - describe 'destroy' do - before do - friend_users(user, aspect, user2, aspect2) - @post = user2.post :status_message, :message => 'GIANTS', :to => aspect2.id - @comment1 = user.comment("yay", :on => @post) - @comment2 = user2.comment("gogogo", :on => @post) - end - - it 'deletes a comment made by that user' do - @post.reload.comments.count.should be 2 - delete :destroy, :id => @comment1.id - Comment.find_by_id(@comment1.id).should be nil - @post.reload.comments.count.should be 1 - end - - it 'does not delete a comment made by another user' do - @post.reload.comments.count.should be 2 - delete :destroy, :id => @comment2.id - Comment.find_by_id(@comment2.id).should_not be nil - @post.reload.comments.count.should be 2 - end - end end