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