##// END OF EJS Templates
test: route: split issue categories test whether scoped under project or not...
Toshi MARUYAMA -
r8428:917d42733add
parent child
Show More
@@ -1,104 +1,107
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../../test_helper', __FILE__)
19 19
20 20 class RoutingIssueCategoriesTest < ActionController::IntegrationTest
21 def test_issue_categories
21 def test_issue_categories_scoped_under_project
22 22 assert_routing(
23 23 { :method => 'get', :path => "/projects/foo/issue_categories" },
24 24 { :controller => 'issue_categories', :action => 'index',
25 25 :project_id => 'foo' }
26 26 )
27 27 assert_routing(
28 28 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
29 29 { :controller => 'issue_categories', :action => 'index',
30 30 :project_id => 'foo', :format => 'xml' }
31 31 )
32 32 assert_routing(
33 33 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
34 34 { :controller => 'issue_categories', :action => 'index',
35 35 :project_id => 'foo', :format => 'json' }
36 36 )
37 37 assert_routing(
38 38 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
39 39 { :controller => 'issue_categories', :action => 'new',
40 40 :project_id => 'foo' }
41 41 )
42 42 assert_routing(
43 43 { :method => 'post', :path => "/projects/foo/issue_categories" },
44 44 { :controller => 'issue_categories', :action => 'create',
45 45 :project_id => 'foo' }
46 46 )
47 47 assert_routing(
48 48 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
49 49 { :controller => 'issue_categories', :action => 'create',
50 50 :project_id => 'foo', :format => 'xml' }
51 51 )
52 52 assert_routing(
53 53 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
54 54 { :controller => 'issue_categories', :action => 'create',
55 55 :project_id => 'foo', :format => 'json' }
56 56 )
57 end
58
59 def test_issue_categories
57 60 assert_routing(
58 61 { :method => 'get', :path => "/issue_categories/1" },
59 62 { :controller => 'issue_categories', :action => 'show', :id => '1' }
60 63 )
61 64 assert_routing(
62 65 { :method => 'get', :path => "/issue_categories/1.xml" },
63 66 { :controller => 'issue_categories', :action => 'show', :id => '1',
64 67 :format => 'xml' }
65 68 )
66 69 assert_routing(
67 70 { :method => 'get', :path => "/issue_categories/1.json" },
68 71 { :controller => 'issue_categories', :action => 'show', :id => '1',
69 72 :format => 'json' }
70 73 )
71 74 assert_routing(
72 75 { :method => 'get', :path => "/issue_categories/1/edit" },
73 76 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
74 77 )
75 78 assert_routing(
76 79 { :method => 'put', :path => "/issue_categories/1" },
77 80 { :controller => 'issue_categories', :action => 'update', :id => '1' }
78 81 )
79 82 assert_routing(
80 83 { :method => 'put', :path => "/issue_categories/1.xml" },
81 84 { :controller => 'issue_categories', :action => 'update', :id => '1',
82 85 :format => 'xml' }
83 86 )
84 87 assert_routing(
85 88 { :method => 'put', :path => "/issue_categories/1.json" },
86 89 { :controller => 'issue_categories', :action => 'update', :id => '1',
87 90 :format => 'json' }
88 91 )
89 92 assert_routing(
90 93 { :method => 'delete', :path => "/issue_categories/1" },
91 94 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
92 95 )
93 96 assert_routing(
94 97 { :method => 'delete', :path => "/issue_categories/1.xml" },
95 98 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
96 99 :format => 'xml' }
97 100 )
98 101 assert_routing(
99 102 { :method => 'delete', :path => "/issue_categories/1.json" },
100 103 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
101 104 :format => 'json' }
102 105 )
103 106 end
104 107 end
General Comments 0
You need to be logged in to leave comments. Login now