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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
3e7d4831
Commit
3e7d4831
authored
6 years ago
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing specs for Presenter
Also add missing interface in abstract class.
parent
1a1fdf8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
app/presenters/clusterable_presenter.rb
app/presenters/clusterable_presenter.rb
+20
-0
spec/presenters/project_clusterable_presenter_spec.rb
spec/presenters/project_clusterable_presenter_spec.rb
+33
-0
No files found.
app/presenters/clusterable_presenter.rb
View file @
3e7d4831
...
...
@@ -27,4 +27,24 @@ class ClusterablePresenter < Gitlab::View::Presenter::Delegated
def
clusterable_params
raise
NotImplementedError
end
def
create_user_clusters_path
raise
NotImplementedError
end
def
create_gcp_clusters_path
raise
NotImplementedError
end
def
cluster_status_cluster_path
(
cluster
,
params
=
{})
raise
NotImplementedError
end
def
install_applications_cluster_path
(
cluster
,
application
)
raise
NotImplementedError
end
def
cluster_path
(
cluster
,
params
=
{})
raise
NotImplementedError
end
end
This diff is collapsed.
Click to expand it.
spec/presenters/project_clusterable_presenter_spec.rb
View file @
3e7d4831
...
...
@@ -7,6 +7,7 @@ describe ProjectClusterablePresenter do
let
(
:presenter
)
{
described_class
.
new
(
project
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
,
projects:
[
project
])
}
describe
'#can_create_cluster?'
do
let
(
:user
)
{
create
(
:user
)
}
...
...
@@ -42,6 +43,38 @@ describe ProjectClusterablePresenter do
it
{
is_expected
.
to
eq
(
new_project_cluster_path
(
project
))
}
end
describe
'#create_user_clusters_path'
do
subject
{
presenter
.
create_user_clusters_path
}
it
{
is_expected
.
to
eq
(
create_user_project_clusters_path
(
project
))
}
end
describe
'#create_gcp_clusters_path'
do
subject
{
presenter
.
create_gcp_clusters_path
}
it
{
is_expected
.
to
eq
(
create_gcp_project_clusters_path
(
project
))
}
end
describe
'#cluster_status_cluster_path'
do
subject
{
presenter
.
cluster_status_cluster_path
(
cluster
)
}
it
{
is_expected
.
to
eq
(
cluster_status_project_cluster_path
(
project
,
cluster
))
}
end
describe
'#install_applications_cluster_path'
do
let
(
:application
)
{
:helm
}
subject
{
presenter
.
install_applications_cluster_path
(
cluster
,
application
)
}
it
{
is_expected
.
to
eq
(
install_applications_project_cluster_path
(
project
,
cluster
,
application
))
}
end
describe
'#cluster_path'
do
subject
{
presenter
.
cluster_path
(
cluster
)
}
it
{
is_expected
.
to
eq
(
project_cluster_path
(
project
,
cluster
))
}
end
describe
'#clusterable_params'
do
subject
{
presenter
.
clusterable_params
}
...
...
This diff is collapsed.
Click to expand it.
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