You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

groups_test.rb 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Redmine - project management software
  2. # Copyright (C) 2006-2015 Jean-Philippe Lang
  3. #
  4. # This program is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU General Public License
  6. # as published by the Free Software Foundation; either version 2
  7. # of the License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program; if not, write to the Free Software
  16. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  17. require File.expand_path('../../../test_helper', __FILE__)
  18. class RoutingGroupsTest < Redmine::RoutingTest
  19. def test_groups
  20. should_route 'GET /groups' => 'groups#index'
  21. should_route 'GET /groups/new' => 'groups#new'
  22. should_route 'POST /groups' => 'groups#create'
  23. should_route 'GET /groups/1' => 'groups#show', :id => '1'
  24. should_route 'GET /groups/1/edit' => 'groups#edit', :id => '1'
  25. should_route 'PUT /groups/1' => 'groups#update', :id => '1'
  26. should_route 'DELETE /groups/1' => 'groups#destroy', :id => '1'
  27. should_route 'GET /groups/1/autocomplete_for_user' => 'groups#autocomplete_for_user', :id => '1'
  28. should_route 'GET /groups/1/autocomplete_for_user.js' => 'groups#autocomplete_for_user', :id => '1', :format => 'js'
  29. end
  30. def test_group_users
  31. should_route 'GET /groups/567/users/new' => 'groups#new_users', :id => '567'
  32. should_route 'POST /groups/567/users' => 'groups#add_users', :id => '567'
  33. should_route 'DELETE /groups/567/users/12' => 'groups#remove_user', :id => '567', :user_id => '12'
  34. end
  35. end