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
751b0df1
Commit
751b0df1
authored
Jan 21, 2022
by
huzaifaiftikhar1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use local variables instead of using let_it_be
parent
a9edd65c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
ee/app/controllers/ee/dashboard/projects_controller.rb
ee/app/controllers/ee/dashboard/projects_controller.rb
+0
-2
ee/spec/models/project_spec.rb
ee/spec/models/project_spec.rb
+9
-9
No files found.
ee/app/controllers/ee/dashboard/projects_controller.rb
View file @
751b0df1
...
...
@@ -41,11 +41,9 @@ module EE
finder_params
=
{
aimed_for_deletion:
true
}
unless
current_user
.
can_admin_all_resources?
# only list projects with at least owner access if the user is not an admin
finder_params
[
:min_access_level
]
=
::
Gitlab
::
Access
::
OWNER
if
::
Gitlab
::
CurrentSettings
.
should_check_namespace_plan?
# only list projects that have delayed deletion feature available
finder_params
[
:feature_available
]
=
:adjourned_deletion_for_projects_and_groups
end
end
...
...
ee/spec/models/project_spec.rb
View file @
751b0df1
...
...
@@ -446,16 +446,16 @@ RSpec.describe Project do
end
describe
'.with_feature_available'
,
:saas
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:ultimate_group
)
{
create
(
:group_with_plan
,
plan: :ultimate_plan
)
}
let_it_be
(
:premium_group
)
{
create
(
:group_with_plan
,
plan: :premium_plan
)
}
let_it_be
(
:no_plan_group
)
{
create
(
:group_with_plan
,
plan:
nil
)
}
let_it_be
(
:ultimate_project
)
{
create
(
:project
,
:archived
,
creator:
user
,
namespace:
ultimate_group
)
}
let_it_be
(
:premium_project
)
{
create
(
:project
,
:archived
,
creator:
user
,
namespace:
premium_group
)
}
let_it_be
(
:no_plan_project
)
{
create
(
:project
,
:archived
,
creator:
user
,
namespace:
no_plan_group
)
}
let_it_be
(
:no_plan_public_project
)
{
create
(
:project
,
:archived
,
creator:
user
,
visibility:
::
Gitlab
::
VisibilityLevel
::
PUBLIC
,
namespace:
no_plan_group
)
}
it
'lists projects with the feature available'
do
user
=
create
(
:user
)
ultimate_group
=
create
(
:group_with_plan
,
plan: :ultimate_plan
)
premium_group
=
create
(
:group_with_plan
,
plan: :premium_plan
)
no_plan_group
=
create
(
:group_with_plan
,
plan:
nil
)
ultimate_project
=
create
(
:project
,
:archived
,
creator:
user
,
namespace:
ultimate_group
)
premium_project
=
create
(
:project
,
:archived
,
creator:
user
,
namespace:
premium_group
)
no_plan_project
=
create
(
:project
,
:archived
,
creator:
user
,
namespace:
no_plan_group
)
no_plan_public_project
=
create
(
:project
,
:archived
,
creator:
user
,
visibility:
::
Gitlab
::
VisibilityLevel
::
PUBLIC
,
namespace:
no_plan_group
)
expect
(
described_class
.
with_feature_available
(
:adjourned_deletion_for_projects_and_groups
)).
to
contain_exactly
(
premium_project
,
ultimate_project
,
no_plan_public_project
)
expect
(
described_class
.
with_feature_available
(
:adjourned_deletion_for_projects_and_groups
)).
not_to
include
(
no_plan_project
)
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