- post :unhidecomment,
- :params => { :display_name => user.display_name, :id => diary_entry.id, :comment => diary_comment.id },
- :session => { :user => user }
+ session_for(user)
+ post unhide_diary_comment_path(:display_name => user.display_name, :id => diary_entry, :comment => diary_comment)
+ assert_response :redirect
+ assert_redirected_to :controller => :errors, :action => :forbidden
+ assert_not DiaryComment.find(diary_comment.id).visible
+
+ # Now try as a moderator
+ session_for(create(:moderator_user))
+ post unhide_diary_comment_path(:display_name => user.display_name, :id => diary_entry, :comment => diary_comment)