summaryrefslogtreecommitdiff
path: root/spec/routing/routing_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-17 11:59:07 +0000
commit8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch)
tree544930fb309b30317ae9797a9683768705d664c4 /spec/routing/routing_spec.rb
parent4b1de649d0168371549608993deac953eb692019 (diff)
downloadgitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'spec/routing/routing_spec.rb')
-rw-r--r--spec/routing/routing_spec.rb39
1 files changed, 31 insertions, 8 deletions
diff --git a/spec/routing/routing_spec.rb b/spec/routing/routing_spec.rb
index 76ccdf3237c..26ad1f14786 100644
--- a/spec/routing/routing_spec.rb
+++ b/spec/routing/routing_spec.rb
@@ -2,7 +2,9 @@
require 'spec_helper'
-# user GET /users/:username/
+# user GET /:username
+# user_ssh_keys GET /:username.keys
+# user_gpg_keys GET /:username.gpg
# user_groups GET /users/:username/groups(.:format)
# user_projects GET /users/:username/projects(.:format)
# user_contributed_projects GET /users/:username/contributed(.:format)
@@ -16,6 +18,12 @@ RSpec.describe UsersController, "routing" do
expect(get("/User")).to route_to('users#show', username: 'User')
end
+ 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
+
it "to #groups" do
expect(get("/users/User/groups")).to route_to('users#groups', username: 'User')
end
@@ -32,6 +40,13 @@ RSpec.describe UsersController, "routing" do
expect(get("/users/User/snippets")).to route_to('users#snippets', username: 'User')
end
+ # 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
+
it "to #calendar" do
expect(get("/users/User/calendar")).to route_to('users#calendar', username: 'User')
end
@@ -54,10 +69,6 @@ RSpec.describe "Mounted Apps", "routing" do
it "to API" do
expect(get("/api/issues")).to be_routable
end
-
- it "to Grack" do
- expect(get("/gitlab/gitlabhq.git")).to be_routable
- end
end
# snippets GET /snippets(.:format) snippets#index
@@ -175,11 +186,23 @@ RSpec.describe Profiles::KeysController, "routing" do
it "to #destroy" do
expect(delete("/profile/keys/1")).to route_to('profiles/keys#destroy', id: '1')
end
+end
- it "to #get_keys" do
- allow_any_instance_of(::Constraints::UserUrlConstrainer).to receive(:matches?).and_return(true)
+# keys GET /gpg_keys gpg_keys#index
+# key POST /gpg_keys gpg_keys#create
+# PUT /gpg_keys/:id gpg_keys#revoke
+# DELETE /gpg_keys/:id gpg_keys#desroy
+RSpec.describe Profiles::GpgKeysController, "routing" do
+ it "to #index" do
+ expect(get("/profile/gpg_keys")).to route_to('profiles/gpg_keys#index')
+ end
- expect(get("/foo.keys")).to route_to('profiles/keys#get_keys', username: 'foo')
+ it "to #create" do
+ expect(post("/profile/gpg_keys")).to route_to('profiles/gpg_keys#create')
+ end
+
+ it "to #destroy" do
+ expect(delete("/profile/gpg_keys/1")).to route_to('profiles/gpg_keys#destroy', id: '1')
end
end