##// END OF EJS Templates
test: route: split roadmap test in versions test...
Toshi MARUYAMA -
r8324:ab60ce54f507
parent child
Show More
@@ -1,116 +1,119
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 RoutingVersionsTest < ActionController::IntegrationTest
21 def test_versions_scoped_under_project
21 def test_roadmap
22 22 # /projects/foo/versions is /projects/foo/roadmap
23 23 assert_routing(
24 24 { :method => 'get', :path => "/projects/33/roadmap" },
25 25 { :controller => 'versions', :action => 'index', :project_id => '33' }
26 26 )
27 end
28
29 def test_versions_scoped_under_project
27 30 assert_routing(
28 31 { :method => 'put', :path => "/projects/foo/versions/close_completed" },
29 32 { :controller => 'versions', :action => 'close_completed',
30 33 :project_id => 'foo' }
31 34 )
32 35 assert_routing(
33 36 { :method => 'get', :path => "/projects/foo/versions.xml" },
34 37 { :controller => 'versions', :action => 'index',
35 38 :project_id => 'foo', :format => 'xml' }
36 39 )
37 40 assert_routing(
38 41 { :method => 'get', :path => "/projects/foo/versions.json" },
39 42 { :controller => 'versions', :action => 'index',
40 43 :project_id => 'foo', :format => 'json' }
41 44 )
42 45 assert_routing(
43 46 { :method => 'get', :path => "/projects/foo/versions/new" },
44 47 { :controller => 'versions', :action => 'new',
45 48 :project_id => 'foo' }
46 49 )
47 50 assert_routing(
48 51 { :method => 'post', :path => "/projects/foo/versions" },
49 52 { :controller => 'versions', :action => 'create',
50 53 :project_id => 'foo' }
51 54 )
52 55 assert_routing(
53 56 { :method => 'post', :path => "/projects/foo/versions.xml" },
54 57 { :controller => 'versions', :action => 'create',
55 58 :project_id => 'foo', :format => 'xml' }
56 59 )
57 60 assert_routing(
58 61 { :method => 'post', :path => "/projects/foo/versions.json" },
59 62 { :controller => 'versions', :action => 'create',
60 63 :project_id => 'foo', :format => 'json' }
61 64 )
62 65 end
63 66
64 67 def test_versions
65 68 assert_routing(
66 69 { :method => 'get', :path => "/versions/1" },
67 70 { :controller => 'versions', :action => 'show', :id => '1' }
68 71 )
69 72 assert_routing(
70 73 { :method => 'get', :path => "/versions/1.xml" },
71 74 { :controller => 'versions', :action => 'show', :id => '1',
72 75 :format => 'xml' }
73 76 )
74 77 assert_routing(
75 78 { :method => 'get', :path => "/versions/1.json" },
76 79 { :controller => 'versions', :action => 'show', :id => '1',
77 80 :format => 'json' }
78 81 )
79 82 assert_routing(
80 83 { :method => 'get', :path => "/versions/1/edit" },
81 84 { :controller => 'versions', :action => 'edit', :id => '1' }
82 85 )
83 86 assert_routing(
84 87 { :method => 'put', :path => "/versions/1" },
85 88 { :controller => 'versions', :action => 'update', :id => '1' }
86 89 )
87 90 assert_routing(
88 91 { :method => 'put', :path => "/versions/1.xml" },
89 92 { :controller => 'versions', :action => 'update', :id => '1',
90 93 :format => 'xml' }
91 94 )
92 95 assert_routing(
93 96 { :method => 'put', :path => "/versions/1.json" },
94 97 { :controller => 'versions', :action => 'update', :id => '1',
95 98 :format => 'json' }
96 99 )
97 100 assert_routing(
98 101 { :method => 'delete', :path => "/versions/1" },
99 102 { :controller => 'versions', :action => 'destroy', :id => '1' }
100 103 )
101 104 assert_routing(
102 105 { :method => 'delete', :path => "/versions/1.xml" },
103 106 { :controller => 'versions', :action => 'destroy', :id => '1',
104 107 :format => 'xml' }
105 108 )
106 109 assert_routing(
107 110 { :method => 'delete', :path => "/versions/1.json" },
108 111 { :controller => 'versions', :action => 'destroy', :id => '1',
109 112 :format => 'json' }
110 113 )
111 114 assert_routing(
112 115 { :method => 'post', :path => "/versions/1/status_by" },
113 116 { :controller => 'versions', :action => 'status_by', :id => '1' }
114 117 )
115 118 end
116 119 end
General Comments 0
You need to be logged in to leave comments. Login now