Mercurial > hg > soundsoftware-site
comparison .svn/pristine/e5/e57e448ff5e398f985d2656f35e0c4f0db003780.svn-base @ 1298:4f746d8966dd redmine_2.3_integration
Merge from redmine-2.3 branch to create new branch redmine-2.3-integration
author | Chris Cannam |
---|---|
date | Fri, 14 Jun 2013 09:28:30 +0100 |
parents | 622f24f53b42 |
children |
comparison
equal
deleted
inserted
replaced
1297:0a574315af3e | 1298:4f746d8966dd |
---|---|
1 # Redmine - project management software | |
2 # Copyright (C) 2006-2013 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 | |
18 require File.expand_path('../../../test_helper', __FILE__) | |
19 | |
20 class RoutingGroupsTest < ActionController::IntegrationTest | |
21 def test_groups_resources | |
22 assert_routing( | |
23 { :method => 'get', :path => "/groups" }, | |
24 { :controller => 'groups', :action => 'index' } | |
25 ) | |
26 assert_routing( | |
27 { :method => 'get', :path => "/groups.xml" }, | |
28 { :controller => 'groups', :action => 'index', :format => 'xml' } | |
29 ) | |
30 assert_routing( | |
31 { :method => 'post', :path => "/groups" }, | |
32 { :controller => 'groups', :action => 'create' } | |
33 ) | |
34 assert_routing( | |
35 { :method => 'post', :path => "/groups.xml" }, | |
36 { :controller => 'groups', :action => 'create', :format => 'xml' } | |
37 ) | |
38 assert_routing( | |
39 { :method => 'get', :path => "/groups/new" }, | |
40 { :controller => 'groups', :action => 'new' } | |
41 ) | |
42 assert_routing( | |
43 { :method => 'get', :path => "/groups/1/edit" }, | |
44 { :controller => 'groups', :action => 'edit', :id => '1' } | |
45 ) | |
46 assert_routing( | |
47 { :method => 'get', :path => "/groups/1/autocomplete_for_user" }, | |
48 { :controller => 'groups', :action => 'autocomplete_for_user', :id => '1' } | |
49 ) | |
50 assert_routing( | |
51 { :method => 'get', :path => "/groups/1/autocomplete_for_user.js" }, | |
52 { :controller => 'groups', :action => 'autocomplete_for_user', :id => '1', :format => 'js' } | |
53 ) | |
54 assert_routing( | |
55 { :method => 'get', :path => "/groups/1" }, | |
56 { :controller => 'groups', :action => 'show', :id => '1' } | |
57 ) | |
58 assert_routing( | |
59 { :method => 'get', :path => "/groups/1.xml" }, | |
60 { :controller => 'groups', :action => 'show', :id => '1', :format => 'xml' } | |
61 ) | |
62 assert_routing( | |
63 { :method => 'put', :path => "/groups/1" }, | |
64 { :controller => 'groups', :action => 'update', :id => '1' } | |
65 ) | |
66 assert_routing( | |
67 { :method => 'put', :path => "/groups/1.xml" }, | |
68 { :controller => 'groups', :action => 'update', :id => '1', :format => 'xml' } | |
69 ) | |
70 assert_routing( | |
71 { :method => 'delete', :path => "/groups/1" }, | |
72 { :controller => 'groups', :action => 'destroy', :id => '1' } | |
73 ) | |
74 assert_routing( | |
75 { :method => 'delete', :path => "/groups/1.xml" }, | |
76 { :controller => 'groups', :action => 'destroy', :id => '1', :format => 'xml' } | |
77 ) | |
78 end | |
79 | |
80 def test_groups | |
81 assert_routing( | |
82 { :method => 'post', :path => "/groups/567/users" }, | |
83 { :controller => 'groups', :action => 'add_users', :id => '567' } | |
84 ) | |
85 assert_routing( | |
86 { :method => 'post', :path => "/groups/567/users.xml" }, | |
87 { :controller => 'groups', :action => 'add_users', :id => '567', :format => 'xml' } | |
88 ) | |
89 assert_routing( | |
90 { :method => 'delete', :path => "/groups/567/users/12" }, | |
91 { :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' } | |
92 ) | |
93 assert_routing( | |
94 { :method => 'delete', :path => "/groups/567/users/12.xml" }, | |
95 { :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12', :format => 'xml' } | |
96 ) | |
97 assert_routing( | |
98 { :method => 'post', :path => "/groups/destroy_membership/567" }, | |
99 { :controller => 'groups', :action => 'destroy_membership', :id => '567' } | |
100 ) | |
101 assert_routing( | |
102 { :method => 'post', :path => "/groups/edit_membership/567" }, | |
103 { :controller => 'groups', :action => 'edit_membership', :id => '567' } | |
104 ) | |
105 end | |
106 end |