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
c563e29f
Commit
c563e29f
authored
Apr 24, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of the user_namespace API helper method
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
8b2592ee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
16 deletions
+2
-16
lib/api/helpers.rb
lib/api/helpers.rb
+0
-4
lib/api/namespaces.rb
lib/api/namespaces.rb
+2
-0
spec/lib/api/helpers_spec.rb
spec/lib/api/helpers_spec.rb
+0
-12
No files found.
lib/api/helpers.rb
View file @
c563e29f
...
@@ -67,10 +67,6 @@ module API
...
@@ -67,10 +67,6 @@ module API
initial_current_user
!=
current_user
initial_current_user
!=
current_user
end
end
def
user_namespace
@user_namespace
||=
find_namespace!
(
params
[
:id
])
end
def
user_group
def
user_group
@group
||=
find_group!
(
params
[
:id
])
@group
||=
find_group!
(
params
[
:id
])
end
end
...
...
lib/api/namespaces.rb
View file @
c563e29f
...
@@ -44,6 +44,8 @@ module API
...
@@ -44,6 +44,8 @@ module API
requires
:id
,
type:
String
,
desc:
"Namespace's ID or path"
requires
:id
,
type:
String
,
desc:
"Namespace's ID or path"
end
end
get
':id'
,
requirements:
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
do
get
':id'
,
requirements:
API
::
NAMESPACE_OR_PROJECT_REQUIREMENTS
do
user_namespace
=
find_namespace!
(
params
[
:id
])
present
user_namespace
,
with:
Entities
::
Namespace
,
current_user:
current_user
present
user_namespace
,
with:
Entities
::
Namespace
,
current_user:
current_user
end
end
end
end
...
...
spec/lib/api/helpers_spec.rb
View file @
c563e29f
...
@@ -137,18 +137,6 @@ describe API::Helpers do
...
@@ -137,18 +137,6 @@ describe API::Helpers do
it_behaves_like
'user namespace finder'
it_behaves_like
'user namespace finder'
end
end
describe
'#user_namespace'
do
let
(
:namespace_finder
)
do
subject
.
user_namespace
end
before
do
allow
(
subject
).
to
receive
(
:params
).
and_return
({
id:
namespace
.
id
})
end
it_behaves_like
'user namespace finder'
end
describe
'#send_git_blob'
do
describe
'#send_git_blob'
do
let
(
:repository
)
{
double
}
let
(
:repository
)
{
double
}
let
(
:blob
)
{
double
(
name:
'foobar'
)
}
let
(
:blob
)
{
double
(
name:
'foobar'
)
}
...
...
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