Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
e684c697
Commit
e684c697
authored
Oct 13, 2020
by
Peter Hegman
Committed by
Natalia Tepluhina
Oct 13, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow placeholder for group link route
Allows us to pass route with placeholder to frontend
parent
c2957bce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletion
+22
-1
config/routes/group.rb
config/routes/group.rb
+1
-1
spec/controllers/groups/group_links_controller_spec.rb
spec/controllers/groups/group_links_controller_spec.rb
+21
-0
No files found.
config/routes/group.rb
View file @
e684c697
...
...
@@ -87,7 +87,7 @@ constraints(::Constraints::GroupUrlConstrainer.new) do
delete
:leave
,
on: :collection
end
resources
:group_links
,
only:
[
:create
,
:update
,
:destroy
],
constraints:
{
id:
/\d+/
}
resources
:group_links
,
only:
[
:create
,
:update
,
:destroy
],
constraints:
{
id:
/\d+
|:id
/
}
resources
:uploads
,
only:
[
:create
]
do
collection
do
...
...
spec/controllers/groups/group_links_controller_spec.rb
View file @
e684c697
...
...
@@ -15,6 +15,21 @@ RSpec.describe Groups::GroupLinksController do
shared_with_group
.
add_developer
(
group_member
)
end
shared_examples
'placeholder is passed as `id` parameter'
do
|
action
|
it
'returns a 404'
do
post
(
action
,
params:
{
group_id:
shared_group
,
id:
':id'
},
format: :json
)
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
describe
'#create'
do
let
(
:shared_with_group_id
)
{
shared_with_group
.
id
}
let
(
:shared_group_access
)
{
GroupGroupLink
.
default_access
}
...
...
@@ -125,6 +140,8 @@ RSpec.describe Groups::GroupLinksController do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
include_examples
'placeholder is passed as `id` parameter'
,
:create
end
describe
'#update'
do
...
...
@@ -197,6 +214,8 @@ RSpec.describe Groups::GroupLinksController do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
include_examples
'placeholder is passed as `id` parameter'
,
:update
end
describe
'#destroy'
do
...
...
@@ -232,5 +251,7 @@ RSpec.describe Groups::GroupLinksController do
expect
(
response
).
to
have_gitlab_http_status
(
:not_found
)
end
end
include_examples
'placeholder is passed as `id` parameter'
,
:destroy
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment