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
bf4619e7
Commit
bf4619e7
authored
Jul 07, 2020
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address reviewer comments
parent
42423500
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
1 deletion
+27
-1
ee/spec/serializers/fork_namespace_entity_spec.rb
ee/spec/serializers/fork_namespace_entity_spec.rb
+21
-0
spec/serializers/fork_namespace_entity_spec.rb
spec/serializers/fork_namespace_entity_spec.rb
+5
-0
spec/serializers/fork_namespace_serializer_spec.rb
spec/serializers/fork_namespace_serializer_spec.rb
+1
-1
No files found.
ee/spec/serializers/fork_namespace_entity_spec.rb
0 → 100644
View file @
bf4619e7
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
ForkNamespaceEntity
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let
(
:namespace
)
{
create
(
:group_with_deletion_schedule
,
:with_avatar
,
description:
'test'
,
marked_for_deletion_on:
1
.
day
.
ago
)
}
let
(
:entity
)
{
described_class
.
new
(
namespace
,
current_user:
user
,
project:
project
)
}
subject
(
:json
)
{
entity
.
as_json
}
before
do
stub_licensed_features
(
adjourned_deletion_for_projects_and_groups:
true
)
end
it
'exposes marked_for_deletion state'
do
expect
(
json
[
:marked_for_deletion
]).
to
eq
true
end
end
spec/serializers/fork_namespace_entity_spec.rb
View file @
bf4619e7
...
...
@@ -51,6 +51,11 @@ RSpec.describe ForkNamespaceEntity do
expect
(
json
[
:relative_path
]).
to
eql
polymorphic_path
(
namespace
)
end
it
'exposes human readable permission level'
do
namespace
.
add_developer
(
user
)
expect
(
json
[
:permission
]).
to
eql
'Developer'
end
it
'sets can_create_project to true when user can create projects in namespace'
do
allow
(
user
).
to
receive
(
:can?
).
with
(
:create_projects
,
namespace
).
and_return
(
true
)
...
...
spec/serializers/fork_namespace_serializer_spec.rb
View file @
bf4619e7
...
...
@@ -3,7 +3,7 @@
require
'spec_helper'
RSpec
.
describe
ForkNamespaceSerializer
do
it
'represents
WebIdeTerminal
Entity entities'
do
it
'represents
ForkNamespace
Entity entities'
do
expect
(
described_class
.
entity_class
).
to
eq
(
ForkNamespaceEntity
)
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