Commit 6b90f36f5b6ee36dede7cc33c9364ddd34e5ba6b

Authored by Robert Speicher
1 parent 51c1e499

Updates to routing specs

Showing 1 changed file with 11 additions and 46 deletions   Show diff stats
spec/routing/project_routing_spec.rb
@@ -285,6 +285,7 @@ end @@ -285,6 +285,7 @@ end
285 describe CommitController, "routing" do 285 describe CommitController, "routing" do
286 it "to #show" do 286 it "to #show" do
287 get("/gitlabhq/commit/4246fb").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb') 287 get("/gitlabhq/commit/4246fb").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb')
  288 + get("/gitlabhq/commit/4246fb.patch").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fb', format: 'patch')
288 get("/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fbd13872934f72a8fd0d6fb1317b47b59cb5') 289 get("/gitlabhq/commit/4246fbd13872934f72a8fd0d6fb1317b47b59cb5").should route_to('commit#show', project_id: 'gitlabhq', id: '4246fbd13872934f72a8fd0d6fb1317b47b59cb5')
289 end 290 end
290 end 291 end
@@ -294,16 +295,8 @@ end @@ -294,16 +295,8 @@ end
294 # POST /:project_id/commits(.:format) commits#create 295 # POST /:project_id/commits(.:format) commits#create
295 # project_commit GET /:project_id/commits/:id(.:format) commits#show 296 # project_commit GET /:project_id/commits/:id(.:format) commits#show
296 describe CommitsController, "routing" do 297 describe CommitsController, "routing" do
297 - it "to #patch" do  
298 - get("/gitlabhq/commits/1/patch").should route_to('commits#patch', project_id: 'gitlabhq', id: '1')  
299 - end  
300 -  
301 - it "does something with atom feeds" do  
302 - get("/gitlabhq/commits/master.atom").should route_to('commits#show', project_id: 'gitlabhq', id: 'master.atom')  
303 - end  
304 -  
305 it_behaves_like "RESTful project resources" do 298 it_behaves_like "RESTful project resources" do
306 - let(:actions) { [:index, :show] } 299 + let(:actions) { [:show] }
307 let(:controller) { 'commits' } 300 let(:controller) { 'commits' }
308 end 301 end
309 end 302 end
@@ -384,64 +377,36 @@ describe NotesController, "routing" do @@ -384,64 +377,36 @@ describe NotesController, "routing" do
384 end 377 end
385 end 378 end
386 379
  380 +# project_blame GET /:project_id/blame/:id(.:format) blame#show {:id=>/.+/, :project_id=>/[^\/]+/}
387 describe BlameController, "routing" do 381 describe BlameController, "routing" do
388 it "to #show" do 382 it "to #show" do
389 get("/gitlabhq/blame/master/app/models/project.rb").should route_to('blame#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') 383 get("/gitlabhq/blame/master/app/models/project.rb").should route_to('blame#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
390 end 384 end
391 end 385 end
392 386
  387 +# project_blob GET /:project_id/blob/:id(.:format) blob#show {:id=>/.+/, :project_id=>/[^\/]+/}
393 describe BlobController, "routing" do 388 describe BlobController, "routing" do
394 it "to #show" do 389 it "to #show" do
395 get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') 390 get("/gitlabhq/blob/master/app/models/project.rb").should route_to('blob#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
396 end 391 end
397 end 392 end
398 393
  394 +# project_tree GET /:project_id/tree/:id(.:format) tree#show {:id=>/.+/, :project_id=>/[^\/]+/}
399 describe TreeController, "routing" do 395 describe TreeController, "routing" do
400 it "to #show" do 396 it "to #show" do
401 get("/gitlabhq/tree/master/app/models/project.rb").should route_to('tree#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb') 397 get("/gitlabhq/tree/master/app/models/project.rb").should route_to('tree#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')
402 end 398 end
403 end 399 end
404 400
  401 +# project_compare_index GET /:project_id/compare(.:format) compare#index {:id=>/[^\/]+/, :project_id=>/[^\/]+/}
  402 +# project_compare /:project_id/compare/:from...:to(.:format) compare#show {:from=>/.+/, :to=>/.+/, :id=>/[^\/]+/, :project_id=>/[^\/]+/}
405 describe CompareController, "routing" do 403 describe CompareController, "routing" do
  404 + it "to #index" do
  405 + get("/gitlabhq/compare").should route_to('compare#index', project_id: 'gitlabhq')
  406 + end
  407 +
406 it "to #show" do 408 it "to #show" do
407 get("/gitlabhq/compare/master...stable").should route_to('compare#show', project_id: 'gitlabhq', from: 'master', to: 'stable') 409 get("/gitlabhq/compare/master...stable").should route_to('compare#show', project_id: 'gitlabhq', from: 'master', to: 'stable')
408 get("/gitlabhq/compare/issue/1234...stable").should route_to('compare#show', project_id: 'gitlabhq', from: 'issue/1234', to: 'stable') 410 get("/gitlabhq/compare/issue/1234...stable").should route_to('compare#show', project_id: 'gitlabhq', from: 'issue/1234', to: 'stable')
409 end 411 end
410 end 412 end
411 -  
412 -# TODO: Pending  
413 -#  
414 -# /:project_id/blame/*path  
415 -# /gitlabhq/blame/master/app/contexts/base_context.rb  
416 -# /gitlabhq/blame/test/branch/name/app/contexts/base_context.rb  
417 -#  
418 -# /:project_id/blob/*path  
419 -# /gitlabhq/blob/master/app/contexts/base_context.rb  
420 -# /gitlabhq/blob/test/branch/name/app/contexts/base_context.rb  
421 -#  
422 -# /:project_id/commit/:id  
423 -# /gitlabhq/commit/caef9ed1121a16ca0cc78715695daaa974271bfd  
424 -#  
425 -# /:project_id/commits  
426 -#  
427 -# /:project_id/commits/*path  
428 -# /gitlabhq/commits/master/app/contexts/base_context.rb  
429 -# /gitlabhq/commits/test/branch/name/app/contexts/base_context.rb  
430 -# /gitlabhq/commits/master.atom  
431 -#  
432 -# /:project_id/raw/*path  
433 -# /gitlabhq/raw/master/app/contexts/base_context.rb  
434 -# /gitlabhq/raw/test/branch/name/app/contexts/base_context.rb  
435 -#  
436 -# /:project_id/tree/*path  
437 -# /gitlabhq/tree/master/app  
438 -# /gitlabhq/tree/test/branch/name/app  
439 -describe "pending routing" do  
440 - before { pending }  
441 -  
442 - describe "/:project_id/raw/:id" do  
443 - it "routes to a ref with a path" do  
444 - get("/gitlabhq/raw/master/app/models/project.rb").should route_to('raw#show', project_id: 'gitlabhq', id: 'master/app/models/project.rb')  
445 - end  
446 - end  
447 -end