diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-10-29 18:48:19 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-10-29 18:48:19 +0000 |
commit | 92ec35e6570bffea85ba2669146b7c4fd63f109d (patch) | |
tree | 3605d3f349d8eb4ac53ff3fe6406c078d9438710 /test | |
parent | e64fb6a728743cafed0bfe7d092e484cf74e85ca (diff) | |
download | redmine-92ec35e6570bffea85ba2669146b7c4fd63f109d.tar.gz redmine-92ec35e6570bffea85ba2669146b7c4fd63f109d.zip |
Unified UsersController#list and #index.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2991 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/users_controller_test.rb | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb index af7ba1b51..74cfb656d 100644 --- a/test/functional/users_controller_test.rb +++ b/test/functional/users_controller_test.rb @@ -35,40 +35,39 @@ class UsersControllerTest < ActionController::TestCase end def test_index_routing - #TODO: unify with list assert_generates( '/users', :controller => 'users', :action => 'index' ) + assert_routing( + {:method => :get, :path => '/users'}, + :controller => 'users', :action => 'index' + ) + assert_recognizes( + {:controller => 'users', :action => 'index'}, + {:method => :get, :path => '/users'} + ) end def test_index get :index assert_response :success - assert_template 'list' - end - - def test_list_routing - #TODO: rename action to index - assert_routing( - {:method => :get, :path => '/users'}, - :controller => 'users', :action => 'list' - ) + assert_template 'index' end - def test_list - get :list + def test_index + get :index assert_response :success - assert_template 'list' + assert_template 'index' assert_not_nil assigns(:users) # active users only assert_nil assigns(:users).detect {|u| !u.active?} end - def test_list_with_name_filter - get :list, :name => 'john' + def test_index_with_name_filter + get :index, :name => 'john' assert_response :success - assert_template 'list' + assert_template 'index' users = assigns(:users) assert_not_nil users assert_equal 1, users.size |