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
b8ce0c78
Commit
b8ce0c78
authored
Oct 28, 2021
by
anna_vovchenko
Committed by
Nicolò Maria Mezzopera
Oct 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented suggested changes afte BE review
parent
5e079725
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
7 deletions
+30
-7
spec/helpers/clusters_helper_spec.rb
spec/helpers/clusters_helper_spec.rb
+30
-7
No files found.
spec/helpers/clusters_helper_spec.rb
View file @
b8ce0c78
...
@@ -96,7 +96,7 @@ RSpec.describe ClustersHelper do
...
@@ -96,7 +96,7 @@ RSpec.describe ClustersHelper do
subject
{
helper
.
js_clusters_list_data
(
clusterable
)
}
subject
{
helper
.
js_clusters_list_data
(
clusterable
)
}
it
'displays endpoint path'
do
it
'displays endpoint path'
do
expect
(
subject
[
:endpoint
]).
to
eq
(
clusterable
.
index_path
(
format: :json
)
)
expect
(
subject
[
:endpoint
]).
to
eq
(
"
#{
project_path
(
project
)
}
/-/clusters.json"
)
end
end
it
'generates svg image data'
,
:aggregate_failures
do
it
'generates svg image data'
,
:aggregate_failures
do
...
@@ -117,16 +117,39 @@ RSpec.describe ClustersHelper do
...
@@ -117,16 +117,39 @@ RSpec.describe ClustersHelper do
expect
(
subject
[
:clusters_empty_state_image
]).
to
match
(
%r(/illustrations/logos/clusters_empty|svg)
)
expect
(
subject
[
:clusters_empty_state_image
]).
to
match
(
%r(/illustrations/logos/clusters_empty|svg)
)
end
end
it
'displays
empty state help text
'
do
it
'displays
create cluster using certificate path
'
do
expect
(
subject
[
:
empty_state_help_text
]).
to
eq
(
clusterable
.
empty_state_help_text
)
expect
(
subject
[
:
new_cluster_path
]).
to
eq
(
"
#{
project_path
(
project
)
}
/-/clusters/new?tab=create"
)
end
end
it
'displays create cluster using certificate path'
do
context
'user has no permissions to create a cluster'
do
expect
(
subject
[
:new_cluster_path
]).
to
eq
(
clusterable
.
new_path
(
tab:
'create'
))
it
'displays that user can\t add cluster'
do
expect
(
subject
[
:can_add_cluster
]).
to
eq
(
"false"
)
end
end
context
'user is a maintainer'
do
before
do
project
.
add_maintainer
(
current_user
)
end
it
'displays that the user can add cluster'
do
expect
(
subject
[
:can_add_cluster
]).
to
eq
(
"true"
)
end
end
end
it
'displays whether the user can add cluster'
do
context
'project cluster'
do
expect
(
subject
[
:can_add_cluster
]).
to
eq
(
clusterable
.
can_add_cluster?
.
to_s
)
it
'doesn\'t display empty state help text'
do
expect
(
subject
[
:empty_state_help_text
]).
to
be_nil
end
end
context
'group cluster'
do
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:clusterable
)
{
ClusterablePresenter
.
fabricate
(
group
,
current_user:
current_user
)
}
it
'displays empty state help text'
do
expect
(
subject
[
:empty_state_help_text
]).
to
eq
(
s_
(
'ClusterIntegration|Adding an integration to your group will share the cluster across all your projects.'
))
end
end
end
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