summaryrefslogtreecommitdiffstats
path: root/test/functional/users_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-16 18:20:08 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-03-16 18:20:08 +0000
commit899d410e0bfba47511dabe8413905bd489f7d960 (patch)
treeeb893b76d1b623709aa2b849d2b188c52b7dc2fd /test/functional/users_controller_test.rb
parent0786b9ef99b0797f06a72201b1581d7384efc624 (diff)
downloadredmine-899d410e0bfba47511dabe8413905bd489f7d960.tar.gz
redmine-899d410e0bfba47511dabe8413905bd489f7d960.zip
Adds a Group filter on the admin users list (#7893).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5150 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/users_controller_test.rb')
-rw-r--r--test/functional/users_controller_test.rb15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/functional/users_controller_test.rb b/test/functional/users_controller_test.rb
index 6837deab4..2b34ce9ef 100644
--- a/test/functional/users_controller_test.rb
+++ b/test/functional/users_controller_test.rb
@@ -1,5 +1,5 @@
-# redMine - project management software
-# Copyright (C) 2006-2007 Jean-Philippe Lang
+# Redmine - project management software
+# Copyright (C) 2006-2011 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -24,7 +24,7 @@ class UsersController; def rescue_action(e) raise e end; end
class UsersControllerTest < ActionController::TestCase
include Redmine::I18n
- fixtures :users, :projects, :members, :member_roles, :roles, :auth_sources, :custom_fields, :custom_values
+ fixtures :users, :projects, :members, :member_roles, :roles, :auth_sources, :custom_fields, :custom_values, :groups_users
def setup
@controller = UsersController.new
@@ -59,6 +59,15 @@ class UsersControllerTest < ActionController::TestCase
assert_equal 'John', users.first.firstname
end
+ def test_index_with_group_filter
+ get :index, :group_id => '10'
+ assert_response :success
+ assert_template 'index'
+ users = assigns(:users)
+ assert users.any?
+ assert_equal([], (users - Group.find(10).users))
+ end
+
def test_show
@request.session[:user_id] = nil
get :show, :id => 2