2019-10-29 02:06:14 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2012-09-16 04:21:46 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-12-11 13:09:57 -05:00
|
|
|
# user GET /:username
|
|
|
|
# user_ssh_keys GET /:username.keys
|
2020-12-16 13:10:10 -05:00
|
|
|
# user_gpg_keys GET /:username.gpg
|
2019-06-25 11:37:47 -04:00
|
|
|
# user_groups GET /users/:username/groups(.:format)
|
|
|
|
# user_projects GET /users/:username/projects(.:format)
|
|
|
|
# user_contributed_projects GET /users/:username/contributed(.:format)
|
|
|
|
# user_snippets GET /users/:username/snippets(.:format)
|
|
|
|
# user_calendar GET /users/:username/calendar(.:format)
|
|
|
|
# user_calendar_activities GET /users/:username/calendar_activities(.:format)
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe UsersController, "routing" do
|
2016-05-08 11:06:19 -04:00
|
|
|
it "to #show" do
|
2018-03-08 07:56:54 -05:00
|
|
|
allow_any_instance_of(::Constraints::UserUrlConstrainer).to receive(:matches?).and_return(true)
|
2016-10-06 08:14:24 -04:00
|
|
|
|
|
|
|
expect(get("/User")).to route_to('users#show', username: 'User')
|
2016-05-08 11:06:19 -04:00
|
|
|
end
|
|
|
|
|
2020-12-16 13:10:10 -05:00
|
|
|
it "to #gpg_keys" do
|
|
|
|
allow_any_instance_of(::Constraints::UserUrlConstrainer).to receive(:matches?).and_return(true)
|
|
|
|
|
|
|
|
expect(get("/User.gpg")).to route_to('users#gpg_keys', username: 'User')
|
|
|
|
end
|
|
|
|
|
2016-05-08 11:06:19 -04:00
|
|
|
it "to #groups" do
|
2016-10-13 07:11:26 -04:00
|
|
|
expect(get("/users/User/groups")).to route_to('users#groups', username: 'User')
|
2016-05-08 11:06:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #projects" do
|
2016-10-13 07:11:26 -04:00
|
|
|
expect(get("/users/User/projects")).to route_to('users#projects', username: 'User')
|
2016-05-08 11:06:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #contributed" do
|
2016-10-13 07:11:26 -04:00
|
|
|
expect(get("/users/User/contributed")).to route_to('users#contributed', username: 'User')
|
2016-05-08 11:06:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #snippets" do
|
2016-10-13 07:11:26 -04:00
|
|
|
expect(get("/users/User/snippets")).to route_to('users#snippets', username: 'User')
|
2016-05-08 11:06:19 -04:00
|
|
|
end
|
|
|
|
|
2020-12-11 13:09:57 -05:00
|
|
|
# get all the ssh-keys of a user
|
|
|
|
it "to #ssh_keys" do
|
|
|
|
allow_any_instance_of(::Constraints::UserUrlConstrainer).to receive(:matches?).and_return(true)
|
|
|
|
|
|
|
|
expect(get("/User.keys")).to route_to('users#ssh_keys', username: 'User')
|
|
|
|
end
|
|
|
|
|
2016-05-08 11:06:19 -04:00
|
|
|
it "to #calendar" do
|
2016-10-13 07:11:26 -04:00
|
|
|
expect(get("/users/User/calendar")).to route_to('users#calendar', username: 'User')
|
2016-05-08 11:06:19 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #calendar_activities" do
|
2016-10-13 07:11:26 -04:00
|
|
|
expect(get("/users/User/calendar_activities")).to route_to('users#calendar_activities', username: 'User')
|
2016-05-08 11:06:19 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-09-16 04:21:46 -04:00
|
|
|
# search GET /search(.:format) search#show
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe SearchController, "routing" do
|
2012-09-16 04:21:46 -04:00
|
|
|
it "to #show" do
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(get("/search")).to route_to('search#show')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-05-14 08:33:31 -04:00
|
|
|
# gitlab_api /api API::API
|
2012-09-16 04:21:46 -04:00
|
|
|
# /:path Grack
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe "Mounted Apps", "routing" do
|
2012-09-16 04:21:46 -04:00
|
|
|
it "to API" do
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(get("/api/issues")).to be_routable
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-03-24 15:55:51 -04:00
|
|
|
# snippets GET /snippets(.:format) snippets#index
|
|
|
|
# new_snippet GET /snippets/new(.:format) snippets#new
|
|
|
|
# edit_snippet GET /snippets/:id/edit(.:format) snippets#edit
|
|
|
|
# snippet GET /snippets/:id(.:format) snippets#show
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe SnippetsController, "routing" do
|
2013-03-24 15:55:51 -04:00
|
|
|
it "to #raw" do
|
2020-07-23 11:09:28 -04:00
|
|
|
expect(get("/-/snippets/1/raw")).to route_to('snippets#raw', id: '1')
|
2013-03-24 15:55:51 -04:00
|
|
|
end
|
|
|
|
|
2016-05-08 04:27:33 -04:00
|
|
|
it "to #index" do
|
2020-07-23 11:09:28 -04:00
|
|
|
expect(get("/-/snippets")).to route_to('snippets#index')
|
2016-05-08 04:27:33 -04:00
|
|
|
end
|
|
|
|
|
2013-03-24 15:55:51 -04:00
|
|
|
it "to #new" do
|
2020-07-23 11:09:28 -04:00
|
|
|
expect(get("/-/snippets/new")).to route_to('snippets#new')
|
2013-03-24 15:55:51 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #edit" do
|
2020-07-23 11:09:28 -04:00
|
|
|
expect(get("/-/snippets/1/edit")).to route_to('snippets#edit', id: '1')
|
2013-03-24 15:55:51 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #show" do
|
2020-07-23 11:09:28 -04:00
|
|
|
expect(get("/-/snippets/1")).to route_to('snippets#show', id: '1')
|
2013-03-24 15:55:51 -04:00
|
|
|
end
|
|
|
|
|
2020-07-23 11:09:28 -04:00
|
|
|
it 'to #show from unscoped routing' do
|
|
|
|
expect(get("/snippets/1")).to route_to('snippets#show', id: '1')
|
2020-06-22 14:08:47 -04:00
|
|
|
end
|
2013-03-24 15:55:51 -04:00
|
|
|
end
|
|
|
|
|
2015-04-11 16:49:03 -04:00
|
|
|
# help GET /help(.:format) help#index
|
2016-07-11 18:11:33 -04:00
|
|
|
# help_page GET /help/*path(.:format) help#show
|
2015-04-11 16:49:03 -04:00
|
|
|
# help_shortcuts GET /help/shortcuts(.:format) help#shortcuts
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe HelpController, "routing" do
|
2015-04-15 12:24:44 -04:00
|
|
|
it "to #index" do
|
|
|
|
expect(get("/help")).to route_to('help#index')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
|
2015-04-11 16:49:03 -04:00
|
|
|
it 'to #show' do
|
2016-08-25 10:19:14 -04:00
|
|
|
path = '/help/user/markdown.md'
|
2015-04-11 16:49:03 -04:00
|
|
|
expect(get(path)).to route_to('help#show',
|
2016-08-25 10:19:14 -04:00
|
|
|
path: 'user/markdown',
|
2015-04-11 16:49:03 -04:00
|
|
|
format: 'md')
|
2012-09-16 04:21:46 -04:00
|
|
|
|
2020-10-06 05:08:32 -04:00
|
|
|
path = '/help/user/markdown/markdown_logo.png'
|
2015-04-11 16:49:03 -04:00
|
|
|
expect(get(path)).to route_to('help#show',
|
2020-10-06 05:08:32 -04:00
|
|
|
path: 'user/markdown/markdown_logo',
|
2015-04-11 16:49:03 -04:00
|
|
|
format: 'png')
|
2012-12-08 05:42:38 -05:00
|
|
|
end
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
# profile_account GET /-/profile/account(.:format) profile#account
|
|
|
|
# profile_history GET /-/profile/history(.:format) profile#history
|
|
|
|
# profile_password PUT /-/profile/password(.:format) profile#password_update
|
|
|
|
# profile_token GET /-/profile/token(.:format) profile#token
|
|
|
|
# profile GET /-/profile(.:format) profile#show
|
|
|
|
# profile_update PUT /-/profile/update(.:format) profile#update
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe ProfilesController, "routing" do
|
2012-09-16 04:21:46 -04:00
|
|
|
it "to #account" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(get("/-/profile/account")).to route_to('profiles/accounts#show')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
2021-01-18 10:10:42 -05:00
|
|
|
it_behaves_like 'redirecting a legacy path', '/profile/account', '/-/profile/account'
|
2012-09-16 04:21:46 -04:00
|
|
|
|
2015-07-03 07:54:50 -04:00
|
|
|
it "to #audit_log" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(get("/-/profile/audit_log")).to route_to('profiles#audit_log')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
2021-01-18 10:10:42 -05:00
|
|
|
it_behaves_like 'redirecting a legacy path', '/profile/audit_log', '/-/profile/audit_log'
|
2012-09-16 04:21:46 -04:00
|
|
|
|
2018-05-31 10:01:04 -04:00
|
|
|
it "to #reset_feed_token" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(put("/-/profile/reset_feed_token")).to route_to('profiles#reset_feed_token')
|
2017-05-23 11:02:05 -04:00
|
|
|
end
|
|
|
|
|
2012-09-16 04:21:46 -04:00
|
|
|
it "to #show" do
|
2020-10-14 14:08:47 -04:00
|
|
|
expect(get("/-/profile")).to route_to('profiles#show')
|
|
|
|
end
|
2021-01-18 10:10:42 -05:00
|
|
|
it_behaves_like 'redirecting a legacy path', '/profile', '/-/profile'
|
2015-06-05 14:00:21 -04:00
|
|
|
end
|
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
# profile_preferences GET /-/profile/preferences(.:format) profiles/preferences#show
|
|
|
|
# PATCH /-/profile/preferences(.:format) profiles/preferences#update
|
|
|
|
# PUT /-/profile/preferences(.:format) profiles/preferences#update
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe Profiles::PreferencesController, 'routing' do
|
2015-06-05 14:00:21 -04:00
|
|
|
it 'to #show' do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(get('/-/profile/preferences')).to route_to('profiles/preferences#show')
|
2015-06-05 14:00:21 -04:00
|
|
|
end
|
2021-01-18 10:10:42 -05:00
|
|
|
it_behaves_like 'redirecting a legacy path', '/profile/preferences', '/-/profile/preferences'
|
2012-09-16 04:21:46 -04:00
|
|
|
|
2015-06-05 14:00:21 -04:00
|
|
|
it 'to #update' do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(put('/-/profile/preferences')).to route_to('profiles/preferences#update')
|
|
|
|
expect(patch('/-/profile/preferences')).to route_to('profiles/preferences#update')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
# keys GET /-/profile/keys(.:format) keys#index
|
|
|
|
# POST /-/profile/keys(.:format) keys#create
|
|
|
|
# edit_key GET /-/profile/keys/:id/edit(.:format) keys#edit
|
|
|
|
# key GET /-/profile/keys/:id(.:format) keys#show
|
|
|
|
# PUT /-/profile/keys/:id(.:format) keys#update
|
|
|
|
# DELETE /-/profile/keys/:id(.:format) keys#destroy
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe Profiles::KeysController, "routing" do
|
2012-09-16 04:21:46 -04:00
|
|
|
it "to #index" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(get("/-/profile/keys")).to route_to('profiles/keys#index')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
2021-01-18 10:10:42 -05:00
|
|
|
it_behaves_like 'redirecting a legacy path', '/profile/keys', '/-/profile/keys'
|
2012-09-16 04:21:46 -04:00
|
|
|
|
|
|
|
it "to #create" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(post("/-/profile/keys")).to route_to('profiles/keys#create')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #show" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(get("/-/profile/keys/1")).to route_to('profiles/keys#show', id: '1')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
2021-01-18 10:10:42 -05:00
|
|
|
it_behaves_like 'redirecting a legacy path', '/profile/keys/1', '/-/profile/keys/1'
|
2012-09-16 04:21:46 -04:00
|
|
|
|
|
|
|
it "to #destroy" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(delete("/-/profile/keys/1")).to route_to('profiles/keys#destroy', id: '1')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
# keys GET /-/profile/gpg_keys gpg_keys#index
|
|
|
|
# key POST /-/profile/gpg_keys gpg_keys#create
|
|
|
|
# PUT /-/profile/gpg_keys/:id gpg_keys#revoke
|
|
|
|
# DELETE /-/profile/gpg_keys/:id gpg_keys#desroy
|
2020-12-03 13:10:10 -05:00
|
|
|
RSpec.describe Profiles::GpgKeysController, "routing" do
|
|
|
|
it "to #index" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(get("/-/profile/gpg_keys")).to route_to('profiles/gpg_keys#index')
|
2020-12-03 13:10:10 -05:00
|
|
|
end
|
2021-01-18 10:10:42 -05:00
|
|
|
it_behaves_like 'redirecting a legacy path', '/profile/gpg_keys', '/-/profile/gpg_keys'
|
2020-12-03 13:10:10 -05:00
|
|
|
|
|
|
|
it "to #create" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(post("/-/profile/gpg_keys")).to route_to('profiles/gpg_keys#create')
|
2020-12-03 13:10:10 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #destroy" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(delete("/-/profile/gpg_keys/1")).to route_to('profiles/gpg_keys#destroy', id: '1')
|
2020-12-03 13:10:10 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
# emails GET /-/profile/emails(.:format) emails#index
|
|
|
|
# POST /-/profile/emails(.:format) emails#create
|
|
|
|
# DELETE /-/profile/emails/:id(.:format) keys#destroy
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe Profiles::EmailsController, "routing" do
|
2014-02-08 22:08:49 -05:00
|
|
|
it "to #index" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(get("/-/profile/emails")).to route_to('profiles/emails#index')
|
2014-02-08 22:08:49 -05:00
|
|
|
end
|
2021-01-18 10:10:42 -05:00
|
|
|
it_behaves_like 'redirecting a legacy path', '/profile/emails', '/-/profile/emails'
|
2014-02-08 22:08:49 -05:00
|
|
|
|
|
|
|
it "to #create" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(post("/-/profile/emails")).to route_to('profiles/emails#create')
|
2014-02-08 22:08:49 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #destroy" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(delete("/-/profile/emails/1")).to route_to('profiles/emails#destroy', id: '1')
|
2014-02-08 22:08:49 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2021-01-18 10:10:42 -05:00
|
|
|
# profile_avatar DELETE /-/profile/avatar(.:format) profiles/avatars#destroy
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe Profiles::AvatarsController, "routing" do
|
2013-12-02 13:03:07 -05:00
|
|
|
it "to #destroy" do
|
2021-01-18 10:10:42 -05:00
|
|
|
expect(delete("/-/profile/avatar")).to route_to('profiles/avatars#destroy')
|
2013-12-02 13:03:07 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-01-27 06:20:23 -05:00
|
|
|
# dashboard GET /dashboard(.:format) dashboard#show
|
2012-09-16 04:21:46 -04:00
|
|
|
# dashboard_issues GET /dashboard/issues(.:format) dashboard#issues
|
|
|
|
# dashboard_merge_requests GET /dashboard/merge_requests(.:format) dashboard#merge_requests
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe DashboardController, "routing" do
|
2012-09-16 04:21:46 -04:00
|
|
|
it "to #index" do
|
2015-09-08 10:14:14 -04:00
|
|
|
expect(get("/dashboard")).to route_to('dashboard/projects#index')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #issues" do
|
2018-05-31 10:01:04 -04:00
|
|
|
expect(get("/dashboard/issues.html")).to route_to('dashboard#issues', format: 'html')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "to #calendar_issues" do
|
|
|
|
expect(get("/dashboard/issues.ics")).to route_to('dashboard#issues_calendar', format: 'ics')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "to #merge_requests" do
|
2015-02-12 13:17:35 -05:00
|
|
|
expect(get("/dashboard/merge_requests")).to route_to('dashboard#merge_requests')
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2015-06-10 03:59:39 -04:00
|
|
|
# root / root#show
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe RootController, 'routing' do
|
2015-09-08 10:14:14 -04:00
|
|
|
it 'to #index' do
|
|
|
|
expect(get('/')).to route_to('root#index')
|
2015-06-10 03:59:39 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe "Authentication", "routing" do
|
2017-05-18 12:25:50 -04:00
|
|
|
it "GET /users/sign_in" do
|
|
|
|
expect(get("/users/sign_in")).to route_to('sessions#new')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "POST /users/sign_in" do
|
|
|
|
expect(post("/users/sign_in")).to route_to('sessions#create')
|
|
|
|
end
|
|
|
|
|
2020-01-14 07:07:41 -05:00
|
|
|
it "POST /users/sign_out" do
|
|
|
|
expect(post("/users/sign_out")).to route_to('sessions#destroy')
|
2017-05-18 12:25:50 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "POST /users/password" do
|
|
|
|
expect(post("/users/password")).to route_to('passwords#create')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "GET /users/password/new" do
|
|
|
|
expect(get("/users/password/new")).to route_to('passwords#new')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "GET /users/password/edit" do
|
|
|
|
expect(get("/users/password/edit")).to route_to('passwords#edit')
|
|
|
|
end
|
|
|
|
|
|
|
|
it "PUT /users/password" do
|
|
|
|
expect(put("/users/password")).to route_to('passwords#update')
|
|
|
|
end
|
2019-10-31 20:06:02 -04:00
|
|
|
|
|
|
|
context 'with LDAP configured' do
|
|
|
|
include LdapHelpers
|
|
|
|
|
|
|
|
let(:ldap_settings) { { enabled: true } }
|
|
|
|
|
|
|
|
before do
|
|
|
|
stub_ldap_setting(ldap_settings)
|
|
|
|
Rails.application.reload_routes!
|
|
|
|
end
|
|
|
|
|
|
|
|
after(:all) do
|
|
|
|
Rails.application.reload_routes!
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'POST /users/auth/ldapmain/callback' do
|
|
|
|
expect(post("/users/auth/ldapmain/callback")).to route_to('ldap/omniauth_callbacks#ldapmain')
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with LDAP sign-in disabled' do
|
|
|
|
let(:ldap_settings) { { enabled: true, prevent_ldap_sign_in: true } }
|
|
|
|
|
|
|
|
it 'prevents POST /users/auth/ldapmain/callback' do
|
|
|
|
expect(post("/users/auth/ldapmain/callback")).not_to be_routable
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2012-09-16 04:21:46 -04:00
|
|
|
end
|
2014-04-13 11:46:41 -04:00
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe HealthCheckController, 'routing' do
|
2016-05-10 19:19:16 -04:00
|
|
|
it 'to #index' do
|
|
|
|
expect(get('/health_check')).to route_to('health_check#index')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'also supports passing checks in the url' do
|
|
|
|
expect(get('/health_check/email')).to route_to('health_check#index', checks: 'email')
|
|
|
|
end
|
|
|
|
end
|
2020-03-30 11:07:51 -04:00
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe InvitesController, 'routing' do
|
2020-03-30 11:07:51 -04:00
|
|
|
let_it_be(:member) { create(:project_member, :invited) }
|
|
|
|
|
|
|
|
it 'to #show' do
|
|
|
|
expect(get("/-/invites/#{member.invite_token}")).to route_to('invites#show', id: member.invite_token)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'to legacy route' do
|
|
|
|
expect(get("/invites/#{member.invite_token}")).to route_to('invites#show', id: member.invite_token)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe AbuseReportsController, 'routing' do
|
2020-03-30 11:07:51 -04:00
|
|
|
let_it_be(:user) { create(:user) }
|
|
|
|
|
|
|
|
it 'to #new' do
|
|
|
|
expect(get("/-/abuse_reports/new?user_id=#{user.id}")).to route_to('abuse_reports#new', user_id: user.id.to_s)
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'to legacy route' do
|
|
|
|
expect(get("/abuse_reports/new?user_id=#{user.id}")).to route_to('abuse_reports#new', user_id: user.id.to_s)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe SentNotificationsController, 'routing' do
|
2020-03-30 11:07:51 -04:00
|
|
|
it 'to #unsubscribe' do
|
|
|
|
expect(get("/-/sent_notifications/4bee17d4a63ed60cf5db53417e9aeb4c/unsubscribe"))
|
|
|
|
.to route_to('sent_notifications#unsubscribe', id: '4bee17d4a63ed60cf5db53417e9aeb4c')
|
|
|
|
end
|
|
|
|
end
|
2020-04-24 11:09:37 -04:00
|
|
|
|
2020-06-24 02:09:01 -04:00
|
|
|
RSpec.describe AutocompleteController, 'routing' do
|
2020-04-24 11:09:37 -04:00
|
|
|
it 'to #users' do
|
|
|
|
expect(get("/-/autocomplete/users")).to route_to('autocomplete#users')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'to #projects' do
|
|
|
|
expect(get("/-/autocomplete/projects")).to route_to('autocomplete#projects')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'to #award_emojis' do
|
|
|
|
expect(get("/-/autocomplete/award_emojis")).to route_to('autocomplete#award_emojis')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'to #merge_request_target_branches' do
|
|
|
|
expect(get("/-/autocomplete/merge_request_target_branches")).to route_to('autocomplete#merge_request_target_branches')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'to legacy route' do
|
|
|
|
expect(get("/autocomplete/users")).to route_to('autocomplete#users')
|
|
|
|
expect(get("/autocomplete/projects")).to route_to('autocomplete#projects')
|
|
|
|
expect(get("/autocomplete/award_emojis")).to route_to('autocomplete#award_emojis')
|
|
|
|
end
|
|
|
|
end
|
2020-06-22 08:08:47 -04:00
|
|
|
|
2020-06-26 05:08:59 -04:00
|
|
|
RSpec.describe Snippets::BlobsController, "routing" do
|
2020-06-22 08:08:47 -04:00
|
|
|
it "to #raw" do
|
|
|
|
expect(get('/-/snippets/1/raw/master/lib/version.rb'))
|
|
|
|
.to route_to('snippets/blobs#raw', snippet_id: '1', ref: 'master', path: 'lib/version.rb')
|
|
|
|
end
|
|
|
|
end
|
2020-09-30 17:10:09 -04:00
|
|
|
|
|
|
|
RSpec.describe RunnerSetupController, 'routing' do
|
|
|
|
it 'to #platforms' do
|
|
|
|
expect(get("/-/runner_setup/platforms")).to route_to('runner_setup#platforms')
|
|
|
|
end
|
|
|
|
end
|
2020-10-22 08:08:41 -04:00
|
|
|
|
|
|
|
# jwks GET /-/jwks(.:format) jwks#index
|
|
|
|
RSpec.describe JwksController, "routing" do
|
|
|
|
it "to #index" do
|
|
|
|
expect(get('/-/jwks')).to route_to('jwks#index')
|
|
|
|
end
|
|
|
|
end
|