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
80cf553a
Commit
80cf553a
authored
Mar 16, 2022
by
anna_vovchenko
Committed by
charlie ablett
Mar 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented suggestion changes after the BE review
parent
02e3bcc7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
8 deletions
+23
-8
app/helpers/clusters_helper.rb
app/helpers/clusters_helper.rb
+10
-8
spec/helpers/clusters_helper_spec.rb
spec/helpers/clusters_helper_spec.rb
+13
-0
No files found.
app/helpers/clusters_helper.rb
View file @
80cf553a
...
...
@@ -5,14 +5,6 @@ module ClustersHelper
clusterable
.
is_a?
(
Project
)
end
def
default_branch_name
(
clusterable
)
return
clusterable
.
default_branch
if
clusterable
.
is_a?
(
Project
)
end
def
clusterable_project_path
(
clusterable
)
return
clusterable
.
full_path
if
clusterable
.
is_a?
(
Project
)
end
def
js_clusters_list_data
(
clusterable
)
{
ancestor_help_path:
help_page_path
(
'user/group/clusters/index'
,
anchor:
'cluster-precedence'
),
...
...
@@ -116,4 +108,14 @@ module ClustersHelper
def
can_admin_cluster?
(
user
,
cluster
)
can?
(
user
,
:admin_cluster
,
cluster
)
end
private
def
default_branch_name
(
clusterable
)
return
clusterable
.
default_branch
if
clusterable
.
is_a?
(
Project
)
end
def
clusterable_project_path
(
clusterable
)
return
clusterable
.
full_path
if
clusterable
.
is_a?
(
Project
)
end
end
spec/helpers/clusters_helper_spec.rb
View file @
80cf553a
...
...
@@ -38,6 +38,11 @@ RSpec.describe ClustersHelper do
subject
{
helper
.
js_clusters_list_data
(
clusterable
)
}
before
do
helper
.
send
(
:default_branch_name
,
clusterable
)
helper
.
send
(
:clusterable_project_path
,
clusterable
)
end
it
'displays endpoint path'
do
expect
(
subject
[
:endpoint
]).
to
eq
(
"
#{
project_path
(
project
)
}
/-/clusters.json"
)
end
...
...
@@ -124,6 +129,14 @@ RSpec.describe ClustersHelper do
it
'displays display_cluster_agents as false'
do
expect
(
subject
[
:display_cluster_agents
]).
to
eq
(
"false"
)
end
it
'does not include a default branch'
do
expect
(
subject
[
:default_branch_name
]).
to
be_nil
end
it
'does not include a project path'
do
expect
(
subject
[
:project_path
]).
to
be_nil
end
end
describe
'certificate based clusters enabled'
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