From ef1db967f75d91b2e5f2d8a4ca8c4657de824a4f Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 6 Jul 2017 18:33:17 -0500 Subject: [PATCH] /dmails: allow banned users to read/delete dmails. --- app/controllers/dmails_controller.rb | 2 +- test/functional/dmails_controller_test.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/dmails_controller.rb b/app/controllers/dmails_controller.rb index 3a27011af..1ffc2abf5 100644 --- a/app/controllers/dmails_controller.rb +++ b/app/controllers/dmails_controller.rb @@ -1,6 +1,6 @@ class DmailsController < ApplicationController respond_to :html, :xml, :json - before_filter :member_only + before_filter :member_only, except: [:index, :show, :destroy, :mark_all_as_read] def new if params[:respond_to_id] diff --git a/test/functional/dmails_controller_test.rb b/test/functional/dmails_controller_test.rb index a697a0b75..1c9c74f0e 100644 --- a/test/functional/dmails_controller_test.rb +++ b/test/functional/dmails_controller_test.rb @@ -62,6 +62,13 @@ class DmailsControllerTest < ActionController::TestCase assert_response :success assert_equal(0, assigns[:dmails].size) end + + should "work for banned users" do + ban = FactoryGirl.create(:ban, :user => @user, :banner => FactoryGirl.create(:admin_user)) + get :index, {:search => {:owner_id => @dmail.owner_id, :folder => "sent"}}, {:user_id => @dmail.owner_id} + + assert_response :success + end end context "show action" do