diff options
-rw-r--r-- | app/views/groups/index.html.erb | 11 | ||||
-rw-r--r-- | test/functional/groups_controller_test.rb | 9 |
2 files changed, 20 insertions, 0 deletions
diff --git a/app/views/groups/index.html.erb b/app/views/groups/index.html.erb index 95a683ed8..a8886d0d8 100644 --- a/app/views/groups/index.html.erb +++ b/app/views/groups/index.html.erb @@ -3,6 +3,17 @@ </div> <%= title l(:label_group_plural) %> + +<%= form_tag(groups_path, :method => :get) do %> +<fieldset><legend><%= l(:label_filter_plural) %></legend> + <label for='name'><%= l(:label_group) %>:</label> + <%= text_field_tag 'name', params[:name], :size => 30 %> + <%= submit_tag l(:button_apply), :class => "small", :name => nil %> + <%= link_to l(:button_clear), groups_path, :class => 'icon icon-reload' %> + </fieldset> +<% end %> + + <% if @groups.any? %> <div class="autoscroll"> <table class="list groups"> diff --git a/test/functional/groups_controller_test.rb b/test/functional/groups_controller_test.rb index 481460a06..19f95d357 100644 --- a/test/functional/groups_controller_test.rb +++ b/test/functional/groups_controller_test.rb @@ -36,6 +36,15 @@ class GroupsControllerTest < Redmine::ControllerTest assert_select 'tr#group-11 td.user_count', :text => '1' end + def test_index_with_name_filter + Group.generate!(:name => "Clients") + + get :index, :name => "cli" + assert_response :success + assert_select 'table.groups tbody tr', 1 + assert_select 'table.groups tbody td.name', :text => 'Clients' + end + def test_show get :show, :id => 10 assert_response :success |