Commit 83f24de3520ba1c49544b268253a0665831c2bd5

Authored by Robert Speicher
1 parent 89069dc5

Add routing specs

spec/routing/admin_routing_spec.rb 0 → 100644
... ... @@ -0,0 +1,166 @@
  1 +require 'spec_helper'
  2 +
  3 +# team_update_admin_user PUT /admin/users/:id/team_update(.:format) admin/users#team_update
  4 +# block_admin_user PUT /admin/users/:id/block(.:format) admin/users#block
  5 +# unblock_admin_user PUT /admin/users/:id/unblock(.:format) admin/users#unblock
  6 +# admin_users GET /admin/users(.:format) admin/users#index
  7 +# POST /admin/users(.:format) admin/users#create
  8 +# new_admin_user GET /admin/users/new(.:format) admin/users#new
  9 +# edit_admin_user GET /admin/users/:id/edit(.:format) admin/users#edit
  10 +# admin_user GET /admin/users/:id(.:format) admin/users#show
  11 +# PUT /admin/users/:id(.:format) admin/users#update
  12 +# DELETE /admin/users/:id(.:format) admin/users#destroy
  13 +describe Admin::UsersController, "routing" do
  14 + it "to #team_update" do
  15 + put("/admin/users/1/team_update").should route_to('admin/users#team_update', id: '1')
  16 + end
  17 +
  18 + it "to #block" do
  19 + put("/admin/users/1/block").should route_to('admin/users#block', id: '1')
  20 + end
  21 +
  22 + it "to #unblock" do
  23 + put("/admin/users/1/unblock").should route_to('admin/users#unblock', id: '1')
  24 + end
  25 +
  26 + it "to #index" do
  27 + get("/admin/users").should route_to('admin/users#index')
  28 + end
  29 +
  30 + it "to #show" do
  31 + get("/admin/users/1").should route_to('admin/users#show', id: '1')
  32 + end
  33 +
  34 + it "to #create" do
  35 + post("/admin/users").should route_to('admin/users#create')
  36 + end
  37 +
  38 + it "to #new" do
  39 + get("/admin/users/new").should route_to('admin/users#new')
  40 + end
  41 +
  42 + it "to #edit" do
  43 + get("/admin/users/1/edit").should route_to('admin/users#edit', id: '1')
  44 + end
  45 +
  46 + it "to #show" do
  47 + get("/admin/users/1").should route_to('admin/users#show', id: '1')
  48 + end
  49 +
  50 + it "to #update" do
  51 + put("/admin/users/1").should route_to('admin/users#update', id: '1')
  52 + end
  53 +
  54 + it "to #destroy" do
  55 + delete("/admin/users/1").should route_to('admin/users#destroy', id: '1')
  56 + end
  57 +end
  58 +
  59 +# team_admin_project GET /admin/projects/:id/team(.:format) admin/projects#team {:id=>/[^\/]+/}
  60 +# team_update_admin_project PUT /admin/projects/:id/team_update(.:format) admin/projects#team_update {:id=>/[^\/]+/}
  61 +# admin_projects GET /admin/projects(.:format) admin/projects#index {:id=>/[^\/]+/}
  62 +# POST /admin/projects(.:format) admin/projects#create {:id=>/[^\/]+/}
  63 +# new_admin_project GET /admin/projects/new(.:format) admin/projects#new {:id=>/[^\/]+/}
  64 +# edit_admin_project GET /admin/projects/:id/edit(.:format) admin/projects#edit {:id=>/[^\/]+/}
  65 +# admin_project GET /admin/projects/:id(.:format) admin/projects#show {:id=>/[^\/]+/}
  66 +# PUT /admin/projects/:id(.:format) admin/projects#update {:id=>/[^\/]+/}
  67 +# DELETE /admin/projects/:id(.:format) admin/projects#destroy {:id=>/[^\/]+/}
  68 +describe Admin::ProjectsController, "routing" do
  69 + it "to #team" do
  70 + get("/admin/projects/gitlab/team").should route_to('admin/projects#team', id: 'gitlab')
  71 + end
  72 +
  73 + it "to #team_update" do
  74 + put("/admin/projects/gitlab/team_update").should route_to('admin/projects#team_update', id: 'gitlab')
  75 + end
  76 +
  77 + it "to #index" do
  78 + get("/admin/projects").should route_to('admin/projects#index')
  79 + end
  80 +
  81 + it "to #create" do
  82 + post("/admin/projects").should route_to('admin/projects#create')
  83 + end
  84 +
  85 + it "to #new" do
  86 + get("/admin/projects/new").should route_to('admin/projects#new')
  87 + end
  88 +
  89 + it "to #edit" do
  90 + get("/admin/projects/gitlab/edit").should route_to('admin/projects#edit', id: 'gitlab')
  91 + end
  92 +
  93 + it "to #show" do
  94 + get("/admin/projects/gitlab").should route_to('admin/projects#show', id: 'gitlab')
  95 + end
  96 +
  97 + it "to #update" do
  98 + put("/admin/projects/gitlab").should route_to('admin/projects#update', id: 'gitlab')
  99 + end
  100 +
  101 + it "to #destroy" do
  102 + delete("/admin/projects/gitlab").should route_to('admin/projects#destroy', id: 'gitlab')
  103 + end
  104 +end
  105 +
  106 +# edit_admin_team_member GET /admin/team_members/:id/edit(.:format) admin/team_members#edit
  107 +# admin_team_member PUT /admin/team_members/:id(.:format) admin/team_members#update
  108 +# DELETE /admin/team_members/:id(.:format) admin/team_members#destroy
  109 +describe Admin::TeamMembersController, "routing" do
  110 + it "to #edit" do
  111 + get("/admin/team_members/1/edit").should route_to('admin/team_members#edit', id: '1')
  112 + end
  113 +
  114 + it "to #update" do
  115 + put("/admin/team_members/1").should route_to('admin/team_members#update', id: '1')
  116 + end
  117 +
  118 + it "to #destroy" do
  119 + delete("/admin/team_members/1").should route_to('admin/team_members#destroy', id: '1')
  120 + end
  121 +end
  122 +
  123 +# admin_hook_test GET /admin/hooks/:hook_id/test(.:format) admin/hooks#test
  124 +# admin_hooks GET /admin/hooks(.:format) admin/hooks#index
  125 +# POST /admin/hooks(.:format) admin/hooks#create
  126 +# admin_hook DELETE /admin/hooks/:id(.:format) admin/hooks#destroy
  127 +describe Admin::HooksController, "routing" do
  128 + it "to #test" do
  129 + get("/admin/hooks/1/test").should route_to('admin/hooks#test', hook_id: '1')
  130 + end
  131 +
  132 + it "to #index" do
  133 + get("/admin/hooks").should route_to('admin/hooks#index')
  134 + end
  135 +
  136 + it "to #create" do
  137 + post("/admin/hooks").should route_to('admin/hooks#create')
  138 + end
  139 +
  140 + it "to #destroy" do
  141 + delete("/admin/hooks/1").should route_to('admin/hooks#destroy', id: '1')
  142 + end
  143 +
  144 +end
  145 +
  146 +# admin_logs GET /admin/logs(.:format) admin/logs#show
  147 +describe Admin::LogsController, "routing" do
  148 + it "to #show" do
  149 + get("/admin/logs").should route_to('admin/logs#show')
  150 + end
  151 +end
  152 +
  153 +# admin_resque GET /admin/resque(.:format) admin/resque#show
  154 +describe Admin::ResqueController, "routing" do
  155 + it "to #show" do
  156 + get("/admin/resque").should route_to('admin/resque#show')
  157 + end
  158 +end
  159 +
  160 +# admin_root /admin(.:format) admin/dashboard#index
  161 +describe Admin::DashboardController, "routing" do
  162 + it "to #index" do
  163 + get("/admin").should route_to('admin/dashboard#index')
  164 + end
  165 +end
  166 +
... ...
spec/routing/routing_spec.rb 0 → 100644
... ... @@ -0,0 +1,588 @@
  1 +require 'spec_helper'
  2 +
  3 +# Shared examples for a resource inside a Project
  4 +#
  5 +# By default it tests all the default REST actions: index, create, new, edit,
  6 +# show, update, and destroy. You can remove actions by customizing the
  7 +# `actions` variable.
  8 +#
  9 +# It also expects a `controller` variable to be available which defines both
  10 +# the path to the resource as well as the controller name.
  11 +#
  12 +# Examples
  13 +#
  14 +# # Default behavior
  15 +# it_behaves_like "RESTful project resources" do
  16 +# let(:controller) { 'issues' }
  17 +# end
  18 +#
  19 +# # Customizing actions
  20 +# it_behaves_like "RESTful project resources" do
  21 +# let(:actions) { [:index] }
  22 +# let(:controller) { 'issues' }
  23 +# end
  24 +shared_examples "RESTful project resources" do
  25 + let(:actions) { [:index, :create, :new, :edit, :show, :update, :destroy] }
  26 +
  27 + it "to #index" do
  28 + get("/gitlabhq/#{controller}").should route_to("#{controller}#index", project_id: 'gitlabhq') if actions.include?(:index)
  29 + end
  30 +
  31 + it "to #create" do
  32 + post("/gitlabhq/#{controller}").should route_to("#{controller}#create", project_id: 'gitlabhq') if actions.include?(:create)
  33 + end
  34 +
  35 + it "to #new" do
  36 + get("/gitlabhq/#{controller}/new").should route_to("#{controller}#new", project_id: 'gitlabhq') if actions.include?(:new)
  37 + end
  38 +
  39 + it "to #edit" do
  40 + get("/gitlabhq/#{controller}/1/edit").should route_to("#{controller}#edit", project_id: 'gitlabhq', id: '1') if actions.include?(:edit)
  41 + end
  42 +
  43 + it "to #show" do
  44 + get("/gitlabhq/#{controller}/1").should route_to("#{controller}#show", project_id: 'gitlabhq', id: '1') if actions.include?(:show)
  45 + end
  46 +
  47 + it "to #update" do
  48 + put("/gitlabhq/#{controller}/1").should route_to("#{controller}#update", project_id: 'gitlabhq', id: '1') if actions.include?(:update)
  49 + end
  50 +
  51 + it "to #destroy" do
  52 + delete("/gitlabhq/#{controller}/1").should route_to("#{controller}#destroy", project_id: 'gitlabhq', id: '1') if actions.include?(:destroy)
  53 + end
  54 +end
  55 +
  56 +# search GET /search(.:format) search#show
  57 +describe SearchController, "routing" do
  58 + it "to #show" do
  59 + get("/search").should route_to('search#show')
  60 + end
  61 +end
  62 +
  63 +# gitlab_api /api Gitlab::API
  64 +# resque /info/resque Resque::Server
  65 +# /:path Grack
  66 +describe "Mounted Apps", "routing" do
  67 + it "to API" do
  68 + get("/api").should be_routable
  69 + end
  70 +
  71 + it "to Resque" do
  72 + pending
  73 + get("/info/resque").should be_routable
  74 + end
  75 +
  76 + it "to Grack" do
  77 + get("/gitlabhq.git").should be_routable
  78 + end
  79 +end
  80 +
  81 +# help GET /help(.:format) help#index
  82 +# help_permissions GET /help/permissions(.:format) help#permissions
  83 +# help_workflow GET /help/workflow(.:format) help#workflow
  84 +# help_api GET /help/api(.:format) help#api
  85 +# help_web_hooks GET /help/web_hooks(.:format) help#web_hooks
  86 +# help_system_hooks GET /help/system_hooks(.:format) help#system_hooks
  87 +# help_markdown GET /help/markdown(.:format) help#markdown
  88 +# help_ssh GET /help/ssh(.:format) help#ssh
  89 +describe HelpController, "routing" do
  90 + it "to #index" do
  91 + get("/help").should route_to('help#index')
  92 + end
  93 +
  94 + it "to #permissions" do
  95 + get("/help/permissions").should route_to('help#permissions')
  96 + end
  97 +
  98 + it "to #workflow" do
  99 + get("/help/workflow").should route_to('help#workflow')
  100 + end
  101 +
  102 + it "to #api" do
  103 + get("/help/api").should route_to('help#api')
  104 + end
  105 +
  106 + it "to #web_hooks" do
  107 + get("/help/web_hooks").should route_to('help#web_hooks')
  108 + end
  109 +
  110 + it "to #system_hooks" do
  111 + get("/help/system_hooks").should route_to('help#system_hooks')
  112 + end
  113 +
  114 + it "to #markdown" do
  115 + get("/help/markdown").should route_to('help#markdown')
  116 + end
  117 +
  118 + it "to #ssh" do
  119 + get("/help/ssh").should route_to('help#ssh')
  120 + end
  121 +end
  122 +
  123 +# errors_githost GET /errors/githost(.:format) errors#githost
  124 +describe ErrorsController, "routing" do
  125 + it "to #githost" do
  126 + get("/errors/githost").should route_to('errors#githost')
  127 + end
  128 +end
  129 +
  130 +# profile_account GET /profile/account(.:format) profile#account
  131 +# profile_history GET /profile/history(.:format) profile#history
  132 +# profile_password PUT /profile/password(.:format) profile#password_update
  133 +# profile_token GET /profile/token(.:format) profile#token
  134 +# profile_reset_private_token PUT /profile/reset_private_token(.:format) profile#reset_private_token
  135 +# profile GET /profile(.:format) profile#show
  136 +# profile_design GET /profile/design(.:format) profile#design
  137 +# profile_update PUT /profile/update(.:format) profile#update
  138 +describe ProfileController, "routing" do
  139 + it "to #account" do
  140 + get("/profile/account").should route_to('profile#account')
  141 + end
  142 +
  143 + it "to #history" do
  144 + get("/profile/history").should route_to('profile#history')
  145 + end
  146 +
  147 + it "to #password_update" do
  148 + put("/profile/password").should route_to('profile#password_update')
  149 + end
  150 +
  151 + it "to #token" do
  152 + get("/profile/token").should route_to('profile#token')
  153 + end
  154 +
  155 + it "to #reset_private_token" do
  156 + put("/profile/reset_private_token").should route_to('profile#reset_private_token')
  157 + end
  158 +
  159 + it "to #show" do
  160 + get("/profile").should route_to('profile#show')
  161 + end
  162 +
  163 + it "to #design" do
  164 + get("/profile/design").should route_to('profile#design')
  165 + end
  166 +
  167 + it "to #update" do
  168 + put("/profile/update").should route_to('profile#update')
  169 + end
  170 +end
  171 +
  172 +# keys GET /keys(.:format) keys#index
  173 +# POST /keys(.:format) keys#create
  174 +# new_key GET /keys/new(.:format) keys#new
  175 +# edit_key GET /keys/:id/edit(.:format) keys#edit
  176 +# key GET /keys/:id(.:format) keys#show
  177 +# PUT /keys/:id(.:format) keys#update
  178 +# DELETE /keys/:id(.:format) keys#destroy
  179 +describe KeysController, "routing" do
  180 + it "to #index" do
  181 + get("/keys").should route_to('keys#index')
  182 + end
  183 +
  184 + it "to #create" do
  185 + post("/keys").should route_to('keys#create')
  186 + end
  187 +
  188 + it "to #new" do
  189 + get("/keys/new").should route_to('keys#new')
  190 + end
  191 +
  192 + it "to #edit" do
  193 + get("/keys/1/edit").should route_to('keys#edit', id: '1')
  194 + end
  195 +
  196 + it "to #show" do
  197 + get("/keys/1").should route_to('keys#show', id: '1')
  198 + end
  199 +
  200 + it "to #update" do
  201 + put("/keys/1").should route_to('keys#update', id: '1')
  202 + end
  203 +
  204 + it "to #destroy" do
  205 + delete("/keys/1").should route_to('keys#destroy', id: '1')
  206 + end
  207 +end
  208 +
  209 +# dashboard GET /dashboard(.:format) dashboard#index
  210 +# dashboard_issues GET /dashboard/issues(.:format) dashboard#issues
  211 +# dashboard_merge_requests GET /dashboard/merge_requests(.:format) dashboard#merge_requests
  212 +# root / dashboard#index
  213 +describe DashboardController, "routing" do
  214 + it "to #index" do
  215 + get("/dashboard").should route_to('dashboard#index')
  216 + get("/").should route_to('dashboard#index')
  217 + end
  218 +
  219 + it "to #issues" do
  220 + get("/dashboard/issues").should route_to('dashboard#issues')
  221 + end
  222 +
  223 + it "to #merge_requests" do
  224 + get("/dashboard/merge_requests").should route_to('dashboard#merge_requests')
  225 + end
  226 +end
  227 +
  228 +# projects POST /projects(.:format) projects#create
  229 +# new_project GET /projects/new(.:format) projects#new
  230 +# team_project GET /:id/team(.:format) projects#team
  231 +# wall_project GET /:id/wall(.:format) projects#wall
  232 +# graph_project GET /:id/graph(.:format) projects#graph
  233 +# files_project GET /:id/files(.:format) projects#files
  234 +# edit_project GET /:id/edit(.:format) projects#edit
  235 +# project GET /:id(.:format) projects#show
  236 +# PUT /:id(.:format) projects#update
  237 +# DELETE /:id(.:format) projects#destroy
  238 +describe ProjectsController, "routing" do
  239 + it "to #create" do
  240 + post("/projects").should route_to('projects#create')
  241 + end
  242 +
  243 + it "to #new" do
  244 + get("/projects/new").should route_to('projects#new')
  245 + end
  246 +
  247 + it "to #team" do
  248 + get("/gitlabhq/team").should route_to('projects#team', id: 'gitlabhq')
  249 + end
  250 +
  251 + it "to #wall" do
  252 + get("/gitlabhq/wall").should route_to('projects#wall', id: 'gitlabhq')
  253 + end
  254 +
  255 + it "to #graph" do
  256 + get("/gitlabhq/graph").should route_to('projects#graph', id: 'gitlabhq')
  257 + end
  258 +
  259 + it "to #files" do
  260 + get("/gitlabhq/files").should route_to('projects#files', id: 'gitlabhq')
  261 + end
  262 +
  263 + it "to #edit" do
  264 + get("/gitlabhq/edit").should route_to('projects#edit', id: 'gitlabhq')
  265 + end
  266 +
  267 + it "to #show" do
  268 + get("/gitlabhq").should route_to('projects#show', id: 'gitlabhq')
  269 + end
  270 +
  271 + it "to #update" do
  272 + put("/gitlabhq").should route_to('projects#update', id: 'gitlabhq')
  273 + end
  274 +
  275 + it "to #destroy" do
  276 + delete("/gitlabhq").should route_to('projects#destroy', id: 'gitlabhq')
  277 + end
  278 +end
  279 +
  280 +# new_user_session GET /users/sign_in(.:format) devise/sessions#new
  281 +# user_session POST /users/sign_in(.:format) devise/sessions#create
  282 +# destroy_user_session DELETE /users/sign_out(.:format) devise/sessions#destroy
  283 +# user_omniauth_authorize /users/auth/:provider(.:format) omniauth_callbacks#passthru
  284 +# user_omniauth_callback /users/auth/:action/callback(.:format) omniauth_callbacks#(?-mix:(?!))
  285 +# user_password POST /users/password(.:format) devise/passwords#create
  286 +# new_user_password GET /users/password/new(.:format) devise/passwords#new
  287 +# edit_user_password GET /users/password/edit(.:format) devise/passwords#edit
  288 +# PUT /users/password(.:format) devise/passwords#update
  289 +describe "Authentication", "routing" do
  290 + # pending
  291 +end
  292 +
  293 +# pages_project_wikis GET /:project_id/wikis/pages(.:format) wikis#pages
  294 +# history_project_wiki GET /:project_id/wikis/:id/history(.:format) wikis#history
  295 +# project_wikis POST /:project_id/wikis(.:format) wikis#create
  296 +# edit_project_wiki GET /:project_id/wikis/:id/edit(.:format) wikis#edit
  297 +# project_wiki GET /:project_id/wikis/:id(.:format) wikis#show
  298 +# DELETE /:project_id/wikis/:id(.:format) wikis#destroy
  299 +describe WikisController, "routing" do
  300 + it "to #pages" do
  301 + get("/gitlabhq/wikis/pages").should route_to('wikis#pages', project_id: 'gitlabhq')
  302 + end
  303 +
  304 + it "to #history" do
  305 + get("/gitlabhq/wikis/1/history").should route_to('wikis#history', project_id: 'gitlabhq', id: '1')
  306 + end
  307 +
  308 + it_behaves_like "RESTful project resources" do
  309 + let(:actions) { [:create, :edit, :show, :destroy] }
  310 + let(:controller) { 'wikis' }
  311 + end
  312 +end
  313 +
  314 +# branches_project_repository GET /:project_id/repository/branches(.:format) repositories#branches
  315 +# tags_project_repository GET /:project_id/repository/tags(.:format) repositories#tags
  316 +# archive_project_repository GET /:project_id/repository/archive(.:format) repositories#archive
  317 +# project_repository POST /:project_id/repository(.:format) repositories#create
  318 +# new_project_repository GET /:project_id/repository/new(.:format) repositories#new
  319 +# edit_project_repository GET /:project_id/repository/edit(.:format) repositories#edit
  320 +# GET /:project_id/repository(.:format) repositories#show
  321 +# PUT /:project_id/repository(.:format) repositories#update
  322 +# DELETE /:project_id/repository(.:format) repositories#destroy
  323 +describe RepositoriesController, "routing" do
  324 + it "to #branches" do
  325 + get("/gitlabhq/repository/branches").should route_to('repositories#branches', project_id: 'gitlabhq')
  326 + end
  327 +
  328 + it "to #tags" do
  329 + get("/gitlabhq/repository/tags").should route_to('repositories#tags', project_id: 'gitlabhq')
  330 + end
  331 +
  332 + it "to #archive" do
  333 + get("/gitlabhq/repository/archive").should route_to('repositories#archive', project_id: 'gitlabhq')
  334 + end
  335 +
  336 + it "to #create" do
  337 + post("/gitlabhq/repository").should route_to('repositories#create', project_id: 'gitlabhq')
  338 + end
  339 +
  340 + it "to #new" do
  341 + get("/gitlabhq/repository/new").should route_to('repositories#new', project_id: 'gitlabhq')
  342 + end
  343 +
  344 + it "to #edit" do
  345 + get("/gitlabhq/repository/edit").should route_to('repositories#edit', project_id: 'gitlabhq')
  346 + end
  347 +
  348 + it "to #show" do
  349 + get("/gitlabhq/repository").should route_to('repositories#show', project_id: 'gitlabhq')
  350 + end
  351 +
  352 + it "to #update" do
  353 + put("/gitlabhq/repository").should route_to('repositories#update', project_id: 'gitlabhq')
  354 + end
  355 +
  356 + it "to #destroy" do
  357 + delete("/gitlabhq/repository").should route_to('repositories#destroy', project_id: 'gitlabhq')
  358 + end
  359 +end
  360 +
  361 +# project_deploy_keys GET /:project_id/deploy_keys(.:format) deploy_keys#index
  362 +# POST /:project_id/deploy_keys(.:format) deploy_keys#create
  363 +# new_project_deploy_key GET /:project_id/deploy_keys/new(.:format) deploy_keys#new
  364 +# edit_project_deploy_key GET /:project_id/deploy_keys/:id/edit(.:format) deploy_keys#edit
  365 +# project_deploy_key GET /:project_id/deploy_keys/:id(.:format) deploy_keys#show
  366 +# PUT /:project_id/deploy_keys/:id(.:format) deploy_keys#update
  367 +# DELETE /:project_id/deploy_keys/:id(.:format) deploy_keys#destroy
  368 +describe DeployKeysController, "routing" do
  369 + it_behaves_like "RESTful project resources" do
  370 + let(:controller) { 'deploy_keys' }
  371 + end
  372 +end
  373 +
  374 +# project_protected_branches GET /:project_id/protected_branches(.:format) protected_branches#index
  375 +# POST /:project_id/protected_branches(.:format) protected_branches#create
  376 +# project_protected_branch DELETE /:project_id/protected_branches/:id(.:format) protected_branches#destroy
  377 +describe ProtectedBranchesController, "routing" do
  378 + it_behaves_like "RESTful project resources" do
  379 + let(:actions) { [:index, :create, :destroy] }
  380 + let(:controller) { 'protected_branches' }
  381 + end
  382 +end
  383 +
  384 +# switch_project_refs GET /:project_id/switch(.:format) refs#switch
  385 +# tree_project_ref GET /:project_id/:id/tree(.:format) refs#tree
  386 +# logs_tree_project_ref GET /:project_id/:id/logs_tree(.:format) refs#logs_tree
  387 +# blob_project_ref GET /:project_id/:id/blob(.:format) refs#blob
  388 +# tree_file_project_ref GET /:project_id/:id/tree/:path(.:format) refs#tree
  389 +# logs_file_project_ref GET /:project_id/:id/logs_tree/:path(.:format) refs#logs_tree
  390 +# blame_file_project_ref GET /:project_id/:id/blame/:path(.:format) refs#blame
  391 +describe RefsController, "routing" do
  392 + it "to #switch" do
  393 + get("/gitlabhq/switch").should route_to('refs#switch', project_id: 'gitlabhq')
  394 + end
  395 +
  396 + it "to #tree" do
  397 + get("/gitlabhq/stable/tree").should route_to('refs#tree', project_id: 'gitlabhq', id: 'stable')
  398 + get("/gitlabhq/stable/tree/foo/bar/baz").should route_to('refs#tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
  399 + end
  400 +
  401 + it "to #logs_tree" do
  402 + get("/gitlabhq/stable/logs_tree").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable')
  403 + get("/gitlabhq/stable/logs_tree/foo/bar/baz").should route_to('refs#logs_tree', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
  404 + end
  405 +
  406 + it "to #blob" do
  407 + get("/gitlabhq/stable/blob").should route_to('refs#blob', project_id: 'gitlabhq', id: 'stable')
  408 + end
  409 +
  410 + it "to #blame" do
  411 + get("/gitlabhq/stable/blame/foo/bar/baz").should route_to('refs#blame', project_id: 'gitlabhq', id: 'stable', path: 'foo/bar/baz')
  412 + end
  413 +end
  414 +
  415 +# diffs_project_merge_request GET /:project_id/merge_requests/:id/diffs(.:format) merge_requests#diffs
  416 +# automerge_project_merge_request GET /:project_id/merge_requests/:id/automerge(.:format) merge_requests#automerge
  417 +# automerge_check_project_merge_request GET /:project_id/merge_requests/:id/automerge_check(.:format) merge_requests#automerge_check
  418 +# raw_project_merge_request GET /:project_id/merge_requests/:id/raw(.:format) merge_requests#raw
  419 +# branch_from_project_merge_requests GET /:project_id/merge_requests/branch_from(.:format) merge_requests#branch_from
  420 +# branch_to_project_merge_requests GET /:project_id/merge_requests/branch_to(.:format) merge_requests#branch_to
  421 +# project_merge_requests GET /:project_id/merge_requests(.:format) merge_requests#index
  422 +# POST /:project_id/merge_requests(.:format) merge_requests#create
  423 +# new_project_merge_request GET /:project_id/merge_requests/new(.:format) merge_requests#new
  424 +# edit_project_merge_request GET /:project_id/merge_requests/:id/edit(.:format) merge_requests#edit
  425 +# project_merge_request GET /:project_id/merge_requests/:id(.:format) merge_requests#show
  426 +# PUT /:project_id/merge_requests/:id(.:format) merge_requests#update
  427 +# DELETE /:project_id/merge_requests/:id(.:format) merge_requests#destroy
  428 +describe MergeRequestsController, "routing" do
  429 + it "to #diffs" do
  430 + get("/gitlabhq/merge_requests/1/diffs").should route_to('merge_requests#diffs', project_id: 'gitlabhq', id: '1')
  431 + end
  432 +
  433 + it "to #automerge" do
  434 + get("/gitlabhq/merge_requests/1/automerge").should route_to('merge_requests#automerge', project_id: 'gitlabhq', id: '1')
  435 + end
  436 +
  437 + it "to #automerge_check" do
  438 + get("/gitlabhq/merge_requests/1/automerge_check").should route_to('merge_requests#automerge_check', project_id: 'gitlabhq', id: '1')
  439 + end
  440 +
  441 + it "to #raw" do
  442 + get("/gitlabhq/merge_requests/1/raw").should route_to('merge_requests#raw', project_id: 'gitlabhq', id: '1')
  443 + end
  444 +
  445 + it "to #branch_from" do
  446 + get("/gitlabhq/merge_requests/branch_from").should route_to('merge_requests#branch_from', project_id: 'gitlabhq')
  447 + end
  448 +
  449 + it "to #branch_to" do
  450 + get("/gitlabhq/merge_requests/branch_to").should route_to('merge_requests#branch_to', project_id: 'gitlabhq')
  451 + end
  452 +
  453 + it_behaves_like "RESTful project resources" do
  454 + let(:controller) { 'merge_requests' }
  455 + end
  456 +end
  457 +
  458 +# raw_project_snippet GET /:project_id/snippets/:id/raw(.:format) snippets#raw
  459 +# project_snippets GET /:project_id/snippets(.:format) snippets#index
  460 +# POST /:project_id/snippets(.:format) snippets#create
  461 +# new_project_snippet GET /:project_id/snippets/new(.:format) snippets#new
  462 +# edit_project_snippet GET /:project_id/snippets/:id/edit(.:format) snippets#edit
  463 +# project_snippet GET /:project_id/snippets/:id(.:format) snippets#show
  464 +# PUT /:project_id/snippets/:id(.:format) snippets#update
  465 +# DELETE /:project_id/snippets/:id(.:format) snippets#destroy
  466 +describe SnippetsController, "routing" do
  467 + it "to #raw" do
  468 + get("/gitlabhq/snippets/1/raw").should route_to('snippets#raw', project_id: 'gitlabhq', id: '1')
  469 + end
  470 +
  471 + it_behaves_like "RESTful project resources" do
  472 + let(:controller) { 'snippets' }
  473 + end
  474 +end
  475 +
  476 +# test_project_hook GET /:project_id/hooks/:id/test(.:format) hooks#test
  477 +# project_hooks GET /:project_id/hooks(.:format) hooks#index
  478 +# POST /:project_id/hooks(.:format) hooks#create
  479 +# project_hook DELETE /:project_id/hooks/:id(.:format) hooks#destroy
  480 +describe HooksController, "routing" do
  481 + it "to #test" do
  482 + get("/gitlabhq/hooks/1/test").should route_to('hooks#test', project_id: 'gitlabhq', id: '1')
  483 + end
  484 +
  485 + it_behaves_like "RESTful project resources" do
  486 + let(:actions) { [:index, :create, :destroy] }
  487 + let(:controller) { 'hooks' }
  488 + end
  489 +end
  490 +
  491 +# compare_project_commits GET /:project_id/commits/compare(.:format) commits#compare
  492 +# patch_project_commit GET /:project_id/commits/:id/patch(.:format) commits#patch
  493 +# project_commits GET /:project_id/commits(.:format) commits#index
  494 +# POST /:project_id/commits(.:format) commits#create
  495 +# new_project_commit GET /:project_id/commits/new(.:format) commits#new
  496 +# edit_project_commit GET /:project_id/commits/:id/edit(.:format) commits#edit
  497 +# project_commit GET /:project_id/commits/:id(.:format) commits#show
  498 +# PUT /:project_id/commits/:id(.:format) commits#update
  499 +# DELETE /:project_id/commits/:id(.:format) commits#destroy
  500 +describe CommitsController, "routing" do
  501 + it "to #compare" do
  502 + get("/gitlabhq/commits/compare").should route_to('commits#compare', project_id: 'gitlabhq')
  503 + end
  504 +
  505 + it "to #patch" do
  506 + get("/gitlabhq/commits/1/patch").should route_to('commits#patch', project_id: 'gitlabhq', id: '1')
  507 + end
  508 +
  509 + it_behaves_like "RESTful project resources" do
  510 + let(:controller) { 'commits' }
  511 + end
  512 +end
  513 +
  514 +# project_team_members GET /:project_id/team_members(.:format) team_members#index
  515 +# POST /:project_id/team_members(.:format) team_members#create
  516 +# new_project_team_member GET /:project_id/team_members/new(.:format) team_members#new
  517 +# edit_project_team_member GET /:project_id/team_members/:id/edit(.:format) team_members#edit
  518 +# project_team_member GET /:project_id/team_members/:id(.:format) team_members#show
  519 +# PUT /:project_id/team_members/:id(.:format) team_members#update
  520 +# DELETE /:project_id/team_members/:id(.:format) team_members#destroy
  521 +describe TeamMembersController, "routing" do
  522 + it_behaves_like "RESTful project resources" do
  523 + let(:controller) { 'team_members' }
  524 + end
  525 +end
  526 +
  527 +# project_milestones GET /:project_id/milestones(.:format) milestones#index
  528 +# POST /:project_id/milestones(.:format) milestones#create
  529 +# new_project_milestone GET /:project_id/milestones/new(.:format) milestones#new
  530 +# edit_project_milestone GET /:project_id/milestones/:id/edit(.:format) milestones#edit
  531 +# project_milestone GET /:project_id/milestones/:id(.:format) milestones#show
  532 +# PUT /:project_id/milestones/:id(.:format) milestones#update
  533 +# DELETE /:project_id/milestones/:id(.:format) milestones#destroy
  534 +describe MilestonesController, "routing" do
  535 + it_behaves_like "RESTful project resources" do
  536 + let(:controller) { 'milestones' }
  537 + end
  538 +end
  539 +
  540 +# project_labels GET /:project_id/labels(.:format) labels#index
  541 +describe LabelsController, "routing" do
  542 + it "to #index" do
  543 + get("/gitlabhq/labels").should route_to('labels#index', project_id: 'gitlabhq')
  544 + end
  545 +end
  546 +
  547 +# sort_project_issues POST /:project_id/issues/sort(.:format) issues#sort
  548 +# bulk_update_project_issues POST /:project_id/issues/bulk_update(.:format) issues#bulk_update
  549 +# search_project_issues GET /:project_id/issues/search(.:format) issues#search
  550 +# project_issues GET /:project_id/issues(.:format) issues#index
  551 +# POST /:project_id/issues(.:format) issues#create
  552 +# new_project_issue GET /:project_id/issues/new(.:format) issues#new
  553 +# edit_project_issue GET /:project_id/issues/:id/edit(.:format) issues#edit
  554 +# project_issue GET /:project_id/issues/:id(.:format) issues#show
  555 +# PUT /:project_id/issues/:id(.:format) issues#update
  556 +# DELETE /:project_id/issues/:id(.:format) issues#destroy
  557 +describe IssuesController, "routing" do
  558 + it "to #sort" do
  559 + post("/gitlabhq/issues/sort").should route_to('issues#sort', project_id: 'gitlabhq')
  560 + end
  561 +
  562 + it "to #bulk_update" do
  563 + post("/gitlabhq/issues/bulk_update").should route_to('issues#bulk_update', project_id: 'gitlabhq')
  564 + end
  565 +
  566 + it "to #search" do
  567 + get("/gitlabhq/issues/search").should route_to('issues#search', project_id: 'gitlabhq')
  568 + end
  569 +
  570 + it_behaves_like "RESTful project resources" do
  571 + let(:controller) { 'issues' }
  572 + end
  573 +end
  574 +
  575 +# preview_project_notes POST /:project_id/notes/preview(.:format) notes#preview
  576 +# project_notes GET /:project_id/notes(.:format) notes#index
  577 +# POST /:project_id/notes(.:format) notes#create
  578 +# project_note DELETE /:project_id/notes/:id(.:format) notes#destroy
  579 +describe NotesController, "routing" do
  580 + it "to #preview" do
  581 + post("/gitlabhq/notes/preview").should route_to('notes#preview', project_id: 'gitlabhq')
  582 + end
  583 +
  584 + it_behaves_like "RESTful project resources" do
  585 + let(:actions) { [:index, :create, :destroy] }
  586 + let(:controller) { 'notes' }
  587 + end
  588 +end
... ...