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
40c0a390
Commit
40c0a390
authored
Aug 18, 2020
by
Małgorzata Ksionek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs and rubocop failures
parent
c99e761e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
15 deletions
+7
-15
app/controllers/projects/forks_controller.rb
app/controllers/projects/forks_controller.rb
+1
-4
ee/spec/serializers/fork_namespace_entity_spec.rb
ee/spec/serializers/fork_namespace_entity_spec.rb
+2
-4
spec/serializers/fork_namespace_entity_spec.rb
spec/serializers/fork_namespace_entity_spec.rb
+4
-7
No files found.
app/controllers/projects/forks_controller.rb
View file @
40c0a390
...
...
@@ -107,10 +107,7 @@ class Projects::ForksController < Projects::ApplicationController
end
def
memberships_hash
current_user
.
members
.
inject
({})
do
|
memberships
,
member
|
memberships
[
member
.
source_id
]
=
member
memberships
end
current_user
.
members
.
index_by
(
&
:source_id
)
end
end
...
...
ee/spec/serializers/fork_namespace_entity_spec.rb
View file @
40c0a390
...
...
@@ -8,11 +8,9 @@ RSpec.describe ForkNamespaceEntity do
let
(
:namespace
)
{
create
(
:group_with_deletion_schedule
,
:with_avatar
,
description:
'test'
,
marked_for_deletion_on:
1
.
day
.
ago
)
}
let
(
:memberships
)
do
user
.
members
.
inject
({})
do
|
memberships
,
member
|
memberships
[
member
.
source_id
]
=
member
memberships
end
user
.
members
.
index_by
(
&
:source_id
)
end
let
(
:entity
)
{
described_class
.
new
(
namespace
,
current_user:
user
,
project:
project
,
memberships:
memberships
)
}
subject
(
:json
)
{
entity
.
as_json
}
...
...
spec/serializers/fork_namespace_entity_spec.rb
View file @
40c0a390
...
...
@@ -8,21 +8,18 @@ RSpec.describe ForkNamespaceEntity do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:namespace
)
{
create
(
:group
,
:with_avatar
,
description:
'test'
)
}
let_it_be
(
:namespace
)
{
create
(
:group
,
:with_avatar
,
description:
'test'
)
}
let
(
:memberships
)
do
user
.
members
.
inject
({})
do
|
memberships
,
member
|
memberships
[
member
.
source_id
]
=
member
memberships
end
user
.
members
.
index_by
(
&
:source_id
)
end
let
(
:entity
)
{
described_class
.
new
(
namespace
,
current_user:
user
,
project:
project
,
memberships:
memberships
)
}
subject
(
:json
)
{
entity
.
as_json
}
before
do
project
.
add_maintainer
(
user
)
namespace
.
add_developer
(
user
)
project
.
add_maintainer
(
user
)
end
it
'renders json'
do
...
...
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