##// END OF EJS Templates
test: route: move issue_categories test to new file...
Toshi MARUYAMA -
r8236:216ffa05bcbd
parent child
Show More
@@ -0,0 +1,104
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 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 RoutingIssueCategoriesTest < ActionController::IntegrationTest
21 def test_issue_categories
22 assert_routing(
23 { :method => 'get', :path => "/projects/foo/issue_categories" },
24 { :controller => 'issue_categories', :action => 'index',
25 :project_id => 'foo' }
26 )
27 assert_routing(
28 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
29 { :controller => 'issue_categories', :action => 'index',
30 :project_id => 'foo', :format => 'xml' }
31 )
32 assert_routing(
33 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
34 { :controller => 'issue_categories', :action => 'index',
35 :project_id => 'foo', :format => 'json' }
36 )
37 assert_routing(
38 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
39 { :controller => 'issue_categories', :action => 'new',
40 :project_id => 'foo' }
41 )
42 assert_routing(
43 { :method => 'post', :path => "/projects/foo/issue_categories" },
44 { :controller => 'issue_categories', :action => 'create',
45 :project_id => 'foo' }
46 )
47 assert_routing(
48 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
49 { :controller => 'issue_categories', :action => 'create',
50 :project_id => 'foo', :format => 'xml' }
51 )
52 assert_routing(
53 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
54 { :controller => 'issue_categories', :action => 'create',
55 :project_id => 'foo', :format => 'json' }
56 )
57 assert_routing(
58 { :method => 'get', :path => "/issue_categories/1" },
59 { :controller => 'issue_categories', :action => 'show', :id => '1' }
60 )
61 assert_routing(
62 { :method => 'get', :path => "/issue_categories/1.xml" },
63 { :controller => 'issue_categories', :action => 'show', :id => '1',
64 :format => 'xml' }
65 )
66 assert_routing(
67 { :method => 'get', :path => "/issue_categories/1.json" },
68 { :controller => 'issue_categories', :action => 'show', :id => '1',
69 :format => 'json' }
70 )
71 assert_routing(
72 { :method => 'get', :path => "/issue_categories/1/edit" },
73 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
74 )
75 assert_routing(
76 { :method => 'put', :path => "/issue_categories/1" },
77 { :controller => 'issue_categories', :action => 'update', :id => '1' }
78 )
79 assert_routing(
80 { :method => 'put', :path => "/issue_categories/1.xml" },
81 { :controller => 'issue_categories', :action => 'update', :id => '1',
82 :format => 'xml' }
83 )
84 assert_routing(
85 { :method => 'put', :path => "/issue_categories/1.json" },
86 { :controller => 'issue_categories', :action => 'update', :id => '1',
87 :format => 'json' }
88 )
89 assert_routing(
90 { :method => 'delete', :path => "/issue_categories/1" },
91 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
92 )
93 assert_routing(
94 { :method => 'delete', :path => "/issue_categories/1.xml" },
95 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
96 :format => 'xml' }
97 )
98 assert_routing(
99 { :method => 'delete', :path => "/issue_categories/1.json" },
100 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
101 :format => 'json' }
102 )
103 end
104 end
@@ -18,90 +18,6
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class RoutingTest < ActionController::IntegrationTest
20 class RoutingTest < ActionController::IntegrationTest
21 def test_issue_categories
22 assert_routing(
23 { :method => 'get', :path => "/projects/foo/issue_categories" },
24 { :controller => 'issue_categories', :action => 'index',
25 :project_id => 'foo' }
26 )
27 assert_routing(
28 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
29 { :controller => 'issue_categories', :action => 'index',
30 :project_id => 'foo', :format => 'xml' }
31 )
32 assert_routing(
33 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
34 { :controller => 'issue_categories', :action => 'index',
35 :project_id => 'foo', :format => 'json' }
36 )
37 assert_routing(
38 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
39 { :controller => 'issue_categories', :action => 'new',
40 :project_id => 'foo' }
41 )
42 assert_routing(
43 { :method => 'post', :path => "/projects/foo/issue_categories" },
44 { :controller => 'issue_categories', :action => 'create',
45 :project_id => 'foo' }
46 )
47 assert_routing(
48 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
49 { :controller => 'issue_categories', :action => 'create',
50 :project_id => 'foo', :format => 'xml' }
51 )
52 assert_routing(
53 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
54 { :controller => 'issue_categories', :action => 'create',
55 :project_id => 'foo', :format => 'json' }
56 )
57 assert_routing(
58 { :method => 'get', :path => "/issue_categories/1" },
59 { :controller => 'issue_categories', :action => 'show', :id => '1' }
60 )
61 assert_routing(
62 { :method => 'get', :path => "/issue_categories/1.xml" },
63 { :controller => 'issue_categories', :action => 'show', :id => '1',
64 :format => 'xml' }
65 )
66 assert_routing(
67 { :method => 'get', :path => "/issue_categories/1.json" },
68 { :controller => 'issue_categories', :action => 'show', :id => '1',
69 :format => 'json' }
70 )
71 assert_routing(
72 { :method => 'get', :path => "/issue_categories/1/edit" },
73 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
74 )
75 assert_routing(
76 { :method => 'put', :path => "/issue_categories/1" },
77 { :controller => 'issue_categories', :action => 'update', :id => '1' }
78 )
79 assert_routing(
80 { :method => 'put', :path => "/issue_categories/1.xml" },
81 { :controller => 'issue_categories', :action => 'update', :id => '1',
82 :format => 'xml' }
83 )
84 assert_routing(
85 { :method => 'put', :path => "/issue_categories/1.json" },
86 { :controller => 'issue_categories', :action => 'update', :id => '1',
87 :format => 'json' }
88 )
89 assert_routing(
90 { :method => 'delete', :path => "/issue_categories/1" },
91 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
92 )
93 assert_routing(
94 { :method => 'delete', :path => "/issue_categories/1.xml" },
95 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
96 :format => 'xml' }
97 )
98 assert_routing(
99 { :method => 'delete', :path => "/issue_categories/1.json" },
100 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
101 :format => 'json' }
102 )
103 end
104
105 def test_news
21 def test_news
106 assert_routing(
22 assert_routing(
107 { :method => 'get', :path => "/news" },
23 { :method => 'get', :path => "/news" },
General Comments 0
You need to be logged in to leave comments. Login now