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
Boxiang Sun
gitlab-ce
Commits
760a154a
Commit
760a154a
authored
7 years ago
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tests for initial status
parent
55d098c9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
app/models/clusters/applications/helm.rb
app/models/clusters/applications/helm.rb
+2
-0
spec/factories/clusters/applications/helm.rb
spec/factories/clusters/applications/helm.rb
+4
-0
spec/models/clusters/applications/helm_spec.rb
spec/models/clusters/applications/helm_spec.rb
+14
-2
No files found.
app/models/clusters/applications/helm.rb
View file @
760a154a
...
@@ -18,6 +18,8 @@ module Clusters
...
@@ -18,6 +18,8 @@ module Clusters
end
end
def
set_initial_status
def
set_initial_status
return
unless
not_installable?
self
.
status
=
'installable'
if
cluster
&
.
platform_kubernetes_active?
self
.
status
=
'installable'
if
cluster
&
.
platform_kubernetes_active?
end
end
...
...
This diff is collapsed.
Click to expand it.
spec/factories/clusters/applications/helm.rb
View file @
760a154a
...
@@ -2,6 +2,10 @@ FactoryGirl.define do
...
@@ -2,6 +2,10 @@ FactoryGirl.define do
factory
:cluster_applications_helm
,
class:
Clusters
::
Applications
::
Helm
do
factory
:cluster_applications_helm
,
class:
Clusters
::
Applications
::
Helm
do
cluster
factory:
%i(cluster provided_by_gcp)
cluster
factory:
%i(cluster provided_by_gcp)
trait
:not_installable
do
status
-
2
end
trait
:installable
do
trait
:installable
do
status
0
status
0
end
end
...
...
This diff is collapsed.
Click to expand it.
spec/models/clusters/applications/helm_spec.rb
View file @
760a154a
...
@@ -21,8 +21,20 @@ describe Clusters::Applications::Helm do
...
@@ -21,8 +21,20 @@ describe Clusters::Applications::Helm do
end
end
describe
'#status'
do
describe
'#status'
do
it
'defaults to :installable'
do
let
(
:cluster
)
{
create
(
:cluster
)
}
expect
(
subject
.
status_name
).
to
be
(
:installable
)
subject
{
described_class
.
new
(
cluster:
cluster
)
}
it
'defaults to :not_installable'
do
expect
(
subject
.
status_name
).
to
be
(
:not_installable
)
end
context
'when platform kubernetes is defined'
do
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
)
}
it
'defaults to :installable'
do
expect
(
subject
.
status_name
).
to
be
(
:installable
)
end
end
end
end
end
...
...
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