WIP created tests for comments_controller.rb

This commit is contained in:
raluka 2015-09-14 18:50:21 +02:00
parent 81c4d1381c
commit a8815aff5e
3 changed files with 73 additions and 21 deletions

View file

@ -8,6 +8,8 @@ module Admin
@posted_comments = grouped_comments(accessible_ordered_comments.find_comments_by_user(current_user))
end
private
def accessible_ordered_comments
Comment.accessible_by(current_ability).joins('INNER JOIN events ON commentable_id = events.id').order('events.title', 'comments.created_at DESC')
end