##// END OF EJS Templates
test: route: scm: move changes action tests to non revisions path tests...
Toshi MARUYAMA -
r9444:66d62504ef2d
parent child
Show More
@@ -134,31 +134,6 class RoutingRepositoriesTest < ActionController::IntegrationTest
134 )
134 )
135 assert_routing(
135 assert_routing(
136 { :method => 'get',
136 { :method => 'get',
137 :path => "/projects/redmine/repository/changes" },
138 { :controller => 'repositories', :action => 'changes', :id => 'redmine' }
139 )
140 ['2457', 'master', 'slash/slash'].each do |rev|
141 assert_routing(
142 { :method => 'get',
143 :path => "/projects/redmine/repository/changes" },
144 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
145 :rev => rev },
146 {},
147 { :rev => rev }
148 )
149 end
150 ['2457', 'master', 'slash/slash'].each do |rev|
151 assert_routing(
152 { :method => 'get',
153 :path => "/projects/redmine/repository/changes/#{@path_hash[:path]}" },
154 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
155 :path => @path_hash[:param], :rev => rev },
156 {},
157 { :rev => rev }
158 )
159 end
160 assert_routing(
161 { :method => 'get',
162 :path => "/projects/redmine/repository/revisions/2457/diff" },
137 :path => "/projects/redmine/repository/revisions/2457/diff" },
163 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
138 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
164 :rev => '2457' }
139 :rev => '2457' }
@@ -228,31 +203,6 class RoutingRepositoriesTest < ActionController::IntegrationTest
228 )
203 )
229 assert_routing(
204 assert_routing(
230 { :method => 'get',
205 { :method => 'get',
231 :path => "/projects/redmine/repository/foo/changes" },
232 { :controller => 'repositories', :action => 'changes', :id => 'redmine', :repository_id => 'foo' }
233 )
234 ['2457', 'master', 'slash/slash'].each do |rev|
235 assert_routing(
236 { :method => 'get',
237 :path => "/projects/redmine/repository/foo/changes" },
238 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
239 :repository_id => 'foo', :rev => rev },
240 {},
241 { :rev => rev }
242 )
243 end
244 ['2457', 'master', 'slash/slash'].each do |rev|
245 assert_routing(
246 { :method => 'get',
247 :path => "/projects/redmine/repository/foo/changes/#{@path_hash[:path]}" },
248 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
249 :repository_id => 'foo', :path => @path_hash[:param], :rev => rev },
250 {},
251 { :rev => rev }
252 )
253 end
254 assert_routing(
255 { :method => 'get',
256 :path => "/projects/redmine/repository/foo/revisions/2457/diff" },
206 :path => "/projects/redmine/repository/foo/revisions/2457/diff" },
257 { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo',
207 { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo',
258 :rev => '2457' }
208 :rev => '2457' }
@@ -292,6 +242,31 class RoutingRepositoriesTest < ActionController::IntegrationTest
292 def test_repositories_non_revisions_path
242 def test_repositories_non_revisions_path
293 assert_routing(
243 assert_routing(
294 { :method => 'get',
244 { :method => 'get',
245 :path => "/projects/redmine/repository/changes" },
246 { :controller => 'repositories', :action => 'changes', :id => 'redmine' }
247 )
248 ['2457', 'master', 'slash/slash'].each do |rev|
249 assert_routing(
250 { :method => 'get',
251 :path => "/projects/redmine/repository/changes" },
252 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
253 :rev => rev },
254 {},
255 { :rev => rev }
256 )
257 end
258 ['2457', 'master', 'slash/slash'].each do |rev|
259 assert_routing(
260 { :method => 'get',
261 :path => "/projects/redmine/repository/changes/#{@path_hash[:path]}" },
262 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
263 :path => @path_hash[:param], :rev => rev },
264 {},
265 { :rev => rev }
266 )
267 end
268 assert_routing(
269 { :method => 'get',
295 :path => "/projects/redmine/repository/diff/#{@path_hash[:path]}" },
270 :path => "/projects/redmine/repository/diff/#{@path_hash[:path]}" },
296 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
271 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
297 :path => @path_hash[:param] }
272 :path => @path_hash[:param] }
@@ -336,6 +311,33 class RoutingRepositoriesTest < ActionController::IntegrationTest
336 def test_repositories_non_revisions_path_with_repository_id
311 def test_repositories_non_revisions_path_with_repository_id
337 assert_routing(
312 assert_routing(
338 { :method => 'get',
313 { :method => 'get',
314 :path => "/projects/redmine/repository/foo/changes" },
315 { :controller => 'repositories', :action => 'changes',
316 :id => 'redmine', :repository_id => 'foo' }
317 )
318 ['2457', 'master', 'slash/slash'].each do |rev|
319 assert_routing(
320 { :method => 'get',
321 :path => "/projects/redmine/repository/foo/changes" },
322 { :controller => 'repositories', :action => 'changes',
323 :id => 'redmine',
324 :repository_id => 'foo', :rev => rev },
325 {},
326 { :rev => rev }
327 )
328 end
329 ['2457', 'master', 'slash/slash'].each do |rev|
330 assert_routing(
331 { :method => 'get',
332 :path => "/projects/redmine/repository/foo/changes/#{@path_hash[:path]}" },
333 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
334 :repository_id => 'foo', :path => @path_hash[:param], :rev => rev },
335 {},
336 { :rev => rev }
337 )
338 end
339 assert_routing(
340 { :method => 'get',
339 :path => "/projects/redmine/repository/foo/diff/#{@path_hash[:path]}" },
341 :path => "/projects/redmine/repository/foo/diff/#{@path_hash[:path]}" },
340 { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo',
342 { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo',
341 :path => @path_hash[:param] }
343 :path => @path_hash[:param] }
General Comments 0
You need to be logged in to leave comments. Login now