Refactor: Merged RolesController#list and #index
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3435 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
cec2b20793
commit
038a88e970
|
@ -21,16 +21,11 @@ class RolesController < ApplicationController
|
||||||
before_filter :require_admin
|
before_filter :require_admin
|
||||||
|
|
||||||
verify :method => :post, :only => [ :destroy, :move ],
|
verify :method => :post, :only => [ :destroy, :move ],
|
||||||
:redirect_to => { :action => :list }
|
:redirect_to => { :action => :index }
|
||||||
|
|
||||||
def index
|
def index
|
||||||
list
|
|
||||||
render :action => 'list' unless request.xhr?
|
|
||||||
end
|
|
||||||
|
|
||||||
def list
|
|
||||||
@role_pages, @roles = paginate :roles, :per_page => 25, :order => 'builtin, position'
|
@role_pages, @roles = paginate :roles, :per_page => 25, :order => 'builtin, position'
|
||||||
render :action => "list", :layout => false if request.xhr?
|
render :action => "index", :layout => false if request.xhr?
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
|
@ -35,7 +35,7 @@ class RolesControllerTest < ActionController::TestCase
|
||||||
def test_get_index
|
def test_get_index
|
||||||
get :index
|
get :index
|
||||||
assert_response :success
|
assert_response :success
|
||||||
assert_template 'list'
|
assert_template 'index'
|
||||||
|
|
||||||
assert_not_nil assigns(:roles)
|
assert_not_nil assigns(:roles)
|
||||||
assert_equal Role.find(:all, :order => 'builtin, position'), assigns(:roles)
|
assert_equal Role.find(:all, :order => 'builtin, position'), assigns(:roles)
|
||||||
|
|
Loading…
Reference in New Issue