/dmails: allow banned users to read/delete dmails.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
class DmailsController < ApplicationController
|
class DmailsController < ApplicationController
|
||||||
respond_to :html, :xml, :json
|
respond_to :html, :xml, :json
|
||||||
before_filter :member_only
|
before_filter :member_only, except: [:index, :show, :destroy, :mark_all_as_read]
|
||||||
|
|
||||||
def new
|
def new
|
||||||
if params[:respond_to_id]
|
if params[:respond_to_id]
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ class DmailsControllerTest < ActionController::TestCase
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_equal(0, assigns[:dmails].size)
|
assert_equal(0, assigns[:dmails].size)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
context "show action" do
|
context "show action" do
|
||||||
|
|||||||
Reference in New Issue
Block a user