2019-12-26 22:10:19 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
# block_admin_user PUT /admin/users/:id/block(.:format) admin/users#block
|
|
|
|
# unblock_admin_user PUT /admin/users/:id/unblock(.:format) admin/users#unblock
|
|
|
|
# admin_users GET /admin/users(.:format) admin/users#index
|
|
|
|
# POST /admin/users(.:format) admin/users#create
|
|
|
|
# new_admin_user GET /admin/users/new(.:format) admin/users#new
|
|
|
|
# edit_admin_user GET /admin/users/:id/edit(.:format) admin/users#edit
|
|
|
|
# admin_user GET /admin/users/:id(.:format) admin/users#show
|
|
|
|
# PUT /admin/users/:id(.:format) admin/users#update
|
|
|
|
# DELETE /admin/users/:id(.:format) admin/users#destroy
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::UsersController, "routing" do
|
2014-09-02 18:07:02 +05:30
|
|
|
it "to #block" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(put("/admin/users/1/block")).to route_to('admin/users#block', id: '1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #unblock" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(put("/admin/users/1/unblock")).to route_to('admin/users#unblock', id: '1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #index" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(get("/admin/users")).to route_to('admin/users#index')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #show" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(get("/admin/users/1")).to route_to('admin/users#show', id: '1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #create" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(post("/admin/users")).to route_to('admin/users#create')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #new" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(get("/admin/users/new")).to route_to('admin/users#new')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #edit" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(get("/admin/users/1/edit")).to route_to('admin/users#edit', id: '1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #update" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(put("/admin/users/1")).to route_to('admin/users#update', id: '1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #destroy" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(delete("/admin/users/1")).to route_to('admin/users#destroy', id: '1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# team_admin_project GET /admin/projects/:id/team(.:format) admin/projects#team {id: /[^\/]+/}
|
|
|
|
# team_update_admin_project PUT /admin/projects/:id/team_update(.:format) admin/projects#team_update {id: /[^\/]+/}
|
|
|
|
# admin_projects GET /admin/projects(.:format) admin/projects#index {id: /[^\/]+/}
|
|
|
|
# POST /admin/projects(.:format) admin/projects#create {id: /[^\/]+/}
|
|
|
|
# new_admin_project GET /admin/projects/new(.:format) admin/projects#new {id: /[^\/]+/}
|
|
|
|
# edit_admin_project GET /admin/projects/:id/edit(.:format) admin/projects#edit {id: /[^\/]+/}
|
|
|
|
# admin_project GET /admin/projects/:id(.:format) admin/projects#show {id: /[^\/]+/}
|
|
|
|
# PUT /admin/projects/:id(.:format) admin/projects#update {id: /[^\/]+/}
|
|
|
|
# DELETE /admin/projects/:id(.:format) admin/projects#destroy {id: /[^\/]+/}
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::ProjectsController, "routing" do
|
2014-09-02 18:07:02 +05:30
|
|
|
it "to #index" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(get("/admin/projects")).to route_to('admin/projects#index')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #show" do
|
2017-08-17 22:00:37 +05:30
|
|
|
expect(get("/admin/projects/gitlab/gitlab-ce")).to route_to('admin/projects#show', namespace_id: 'gitlab', id: 'gitlab-ce')
|
|
|
|
expect(get("/admin/projects/gitlab/subgroup/gitlab-ce")).to route_to('admin/projects#show', namespace_id: 'gitlab/subgroup', id: 'gitlab-ce')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
# admin_hook_test GET /admin/hooks/:id/test(.:format) admin/hooks#test
|
2014-09-02 18:07:02 +05:30
|
|
|
# admin_hooks GET /admin/hooks(.:format) admin/hooks#index
|
|
|
|
# POST /admin/hooks(.:format) admin/hooks#create
|
|
|
|
# admin_hook DELETE /admin/hooks/:id(.:format) admin/hooks#destroy
|
2017-08-17 22:00:37 +05:30
|
|
|
# PUT /admin/hooks/:id(.:format) admin/hooks#update
|
|
|
|
# edit_admin_hook GET /admin/hooks/:id(.:format) admin/hooks#edit
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::HooksController, "routing" do
|
2014-09-02 18:07:02 +05:30
|
|
|
it "to #test" do
|
2018-10-15 14:42:47 +05:30
|
|
|
expect(post("/admin/hooks/1/test")).to route_to('admin/hooks#test', id: '1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #index" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(get("/admin/hooks")).to route_to('admin/hooks#index')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it "to #create" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(post("/admin/hooks")).to route_to('admin/hooks#create')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2017-08-17 22:00:37 +05:30
|
|
|
it "to #edit" do
|
|
|
|
expect(get("/admin/hooks/1/edit")).to route_to('admin/hooks#edit', id: '1')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "to #update" do
|
|
|
|
expect(put("/admin/hooks/1")).to route_to('admin/hooks#update', id: '1')
|
|
|
|
end
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
it "to #destroy" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(delete("/admin/hooks/1")).to route_to('admin/hooks#destroy', id: '1')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-11-08 19:23:39 +05:30
|
|
|
# admin_hook_hook_log_retry POST /admin/hooks/:hook_id/hook_logs/:id/retry(.:format) admin/hook_logs#retry
|
2017-09-10 17:25:29 +05:30
|
|
|
# admin_hook_hook_log GET /admin/hooks/:hook_id/hook_logs/:id(.:format) admin/hook_logs#show
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::HookLogsController, 'routing' do
|
2017-09-10 17:25:29 +05:30
|
|
|
it 'to #retry' do
|
2018-11-08 19:23:39 +05:30
|
|
|
expect(post('/admin/hooks/1/hook_logs/1/retry')).to route_to('admin/hook_logs#retry', hook_id: '1', id: '1')
|
2017-09-10 17:25:29 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
it 'to #show' do
|
|
|
|
expect(get('/admin/hooks/1/hook_logs/1')).to route_to('admin/hook_logs#show', hook_id: '1', id: '1')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
# admin_background_jobs GET /admin/background_jobs(.:format) admin/background_jobs#show
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::BackgroundJobsController, "routing" do
|
2014-09-02 18:07:02 +05:30
|
|
|
it "to #show" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(get("/admin/background_jobs")).to route_to('admin/background_jobs#show')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
# admin_root /admin(.:format) admin/dashboard#index
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::DashboardController, "routing" do
|
2014-09-02 18:07:02 +05:30
|
|
|
it "to #index" do
|
2015-04-26 12:48:37 +05:30
|
|
|
expect(get("/admin")).to route_to('admin/dashboard#index')
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
2016-06-02 11:05:42 +05:30
|
|
|
|
|
|
|
# admin_health_check GET /admin/health_check(.:format) admin/health_check#show
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::HealthCheckController, "routing" do
|
2016-06-02 11:05:42 +05:30
|
|
|
it "to #show" do
|
|
|
|
expect(get("/admin/health_check")).to route_to('admin/health_check#show')
|
|
|
|
end
|
|
|
|
end
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2020-11-24 15:15:51 +05:30
|
|
|
# admin_dev_ops_report GET /admin/dev_ops_report(.:format) admin/dev_ops_report#show
|
|
|
|
RSpec.describe Admin::DevOpsReportController, "routing" do
|
|
|
|
it "to #show" do
|
|
|
|
expect(get("/admin/dev_ops_report")).to route_to('admin/dev_ops_report#show')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::GroupsController, "routing" do
|
2017-08-17 22:00:37 +05:30
|
|
|
let(:name) { 'complex.group-namegit' }
|
|
|
|
|
|
|
|
it "to #index" do
|
|
|
|
expect(get("/admin/groups")).to route_to('admin/groups#index')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "to #show" do
|
|
|
|
expect(get("/admin/groups/#{name}")).to route_to('admin/groups#show', id: name)
|
|
|
|
expect(get("/admin/groups/#{name}/subgroup")).to route_to('admin/groups#show', id: "#{name}/subgroup")
|
|
|
|
end
|
|
|
|
|
|
|
|
it "to #edit" do
|
|
|
|
expect(get("/admin/groups/#{name}/edit")).to route_to('admin/groups#edit', id: name)
|
|
|
|
end
|
|
|
|
end
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Admin::SessionsController, "routing" do
|
2020-03-13 15:44:24 +05:30
|
|
|
it "to #new" do
|
|
|
|
expect(get("/admin/session/new")).to route_to('admin/sessions#new')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "to #create" do
|
|
|
|
expect(post("/admin/session")).to route_to('admin/sessions#create')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "to #destroy" do
|
|
|
|
expect(post("/admin/session/destroy")).to route_to('admin/sessions#destroy')
|
|
|
|
end
|
|
|
|
end
|
2020-11-24 15:15:51 +05:30
|
|
|
|
|
|
|
RSpec.describe Admin::PlanLimitsController, "routing" do
|
|
|
|
it "to #create" do
|
|
|
|
expect(post("/admin/plan_limits")).to route_to('admin/plan_limits#create')
|
|
|
|
end
|
|
|
|
end
|
2021-01-03 14:25:43 +05:30
|
|
|
|
|
|
|
RSpec.describe Admin::RunnersController, "routing" do
|
|
|
|
it "to #runner_setup_scripts" do
|
|
|
|
expect(get("/admin/runners/runner_setup_scripts")).to route_to('admin/runners#runner_setup_scripts')
|
|
|
|
end
|
|
|
|
end
|