diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-20 17:22:11 +0300 |
commit | 0c872e02b2c822e3397515ec324051ff540f0cd5 (patch) | |
tree | ce2fb6ce7030e4dad0f4118d21ab6453e5938cdd /spec/routing | |
parent | f7e05a6853b12f02911494c4b3fe53d9540d74fc (diff) |
Add latest changes from gitlab-org/gitlab@15-7-stable-eev15.7.0-rc42
Diffstat (limited to 'spec/routing')
-rw-r--r-- | spec/routing/group_routing_spec.rb | 4 | ||||
-rw-r--r-- | spec/routing/project_routing_spec.rb | 5 | ||||
-rw-r--r-- | spec/routing/user_routing_spec.rb | 29 | ||||
-rw-r--r-- | spec/routing/web_ide_routing_spec.rb | 22 |
4 files changed, 58 insertions, 2 deletions
diff --git a/spec/routing/group_routing_spec.rb b/spec/routing/group_routing_spec.rb index 68e619e5246..54fbe9e962d 100644 --- a/spec/routing/group_routing_spec.rb +++ b/spec/routing/group_routing_spec.rb @@ -83,6 +83,10 @@ RSpec.shared_examples 'groups routing' do it 'routes to the observability controller manage method' do expect(get("groups/#{group_path}/-/observability/manage")).to route_to('groups/observability#manage', group_id: group_path) end + + it 'routes to the usage quotas controller' do + expect(get("groups/#{group_path}/-/usage_quotas")).to route_to("groups/usage_quotas#index", group_id: group_path) + end end RSpec.describe "Groups", "routing" do diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index 42196a7d8af..1b6a5182531 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -240,7 +240,7 @@ RSpec.describe 'project routing' do it 'to #show' do expect(get('/gitlab/gitlabhq/-/merge_requests/1.diff')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'diff') expect(get('/gitlab/gitlabhq/-/merge_requests/1.patch')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'patch') - expect(get('/gitlab/gitlabhq/-/merge_requests/1/diffs')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'diffs') + expect(get('/gitlab/gitlabhq/-/merge_requests/1/diffs')).to route_to('projects/merge_requests#diffs', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'diffs') expect(get('/gitlab/gitlabhq/-/merge_requests/1/commits')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'commits') expect(get('/gitlab/gitlabhq/-/merge_requests/1/pipelines')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'pipelines') end @@ -248,7 +248,7 @@ RSpec.describe 'project routing' do it 'to #show from scoped route' do expect(get('/gitlab/gitlabhq/-/merge_requests/1.diff')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'diff') expect(get('/gitlab/gitlabhq/-/merge_requests/1.patch')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', format: 'patch') - expect(get('/gitlab/gitlabhq/-/merge_requests/1/diffs')).to route_to('projects/merge_requests#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'diffs') + expect(get('/gitlab/gitlabhq/-/merge_requests/1/diffs')).to route_to('projects/merge_requests#diffs', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1', tab: 'diffs') end it_behaves_like 'resource routing' do @@ -301,6 +301,7 @@ RSpec.describe 'project routing' do expect(get('/gitlab/gitlabhq/-/merge_requests/1/conflicts')).to route_to('projects/merge_requests/conflicts#show', namespace_id: 'gitlab', project_id: 'gitlabhq', id: '1') end end + # raw_project_snippet GET /:project_id/snippets/:id/raw(.:format) snippets#raw # project_snippets GET /:project_id/snippets(.:format) snippets#index # new_project_snippet GET /:project_id/snippets/new(.:format) snippets#new diff --git a/spec/routing/user_routing_spec.rb b/spec/routing/user_routing_spec.rb new file mode 100644 index 00000000000..7bb589565fa --- /dev/null +++ b/spec/routing/user_routing_spec.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'user routing', :clean_gitlab_redis_sessions, feature_category: :authentication_and_authorization do + include SessionHelpers + + context 'when GitHub OAuth on project import is cancelled' do + it_behaves_like 'redirecting a legacy path', '/users/auth?error=access_denied&state=xyz', '/users/sign_in' + end + + context 'when GitHub OAuth on sign in is cancelled' do + before do + stub_session(auth_on_failure_path: '/projects/new#import_project') + end + + context 'when all required parameters are present' do + it_behaves_like 'redirecting a legacy path', + '/users/auth?error=access_denied&state=xyz', + '/projects/new#import_project' + end + + context 'when one of the required parameters is missing' do + it_behaves_like 'redirecting a legacy path', + '/users/auth?error=access_denied&state=', + '/auth' + end + end +end diff --git a/spec/routing/web_ide_routing_spec.rb b/spec/routing/web_ide_routing_spec.rb new file mode 100644 index 00000000000..58c24189dfd --- /dev/null +++ b/spec/routing/web_ide_routing_spec.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +require "spec_helper" + +RSpec.describe "Web IDE routing", feature_category: :remote_development do + describe 'remote' do + it "routes to #index, without remote_path" do + expect(post("/-/ide/remote/my.env.gitlab.example.com%3A3443")).to route_to( + "web_ide/remote_ide#index", + remote_host: 'my.env.gitlab.example.com:3443' + ) + end + + it "routes to #index, with remote_path" do + expect(post("/-/ide/remote/my.env.gitlab.example.com%3A3443/foo/bar.dev/test.dir")).to route_to( + "web_ide/remote_ide#index", + remote_host: 'my.env.gitlab.example.com:3443', + remote_path: 'foo/bar.dev/test.dir' + ) + end + end +end |