Commit c51270d7eec924fcbffd3682618dabe109480e4b
1 parent
f8b1f66d
Exists in
master
and in
29 other branches
users-controller: default filter to all_users
(ActionItem2995)
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
app/controllers/admin/users_controller.rb
... | ... | @@ -7,7 +7,7 @@ class UsersController < AdminController |
7 | 7 | include UsersHelper |
8 | 8 | |
9 | 9 | def index |
10 | - @filter = params[:filter] | |
10 | + @filter = params[:filter] || 'all_users' | |
11 | 11 | scope = environment.people.no_templates |
12 | 12 | if @filter == 'admin_users' |
13 | 13 | scope = scope.admins | ... | ... |
test/functional/users_controller_test.rb
... | ... | @@ -117,6 +117,11 @@ class UsersControllerTest < ActionController::TestCase |
117 | 117 | assert_order ['ana', 'bill', 'creed', 'jeremy'], assigns(:collection).map(&:name) |
118 | 118 | end |
119 | 119 | |
120 | + should 'set filter to all_users by default' do | |
121 | + get :index | |
122 | + assert_equal 'all_users', assigns(:filter) | |
123 | + end | |
124 | + | |
120 | 125 | should 'response as XML to export users' do |
121 | 126 | get :download, :format => 'xml' |
122 | 127 | assert_equal 'text/xml', @response.content_type | ... | ... |