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
ce704a95
Commit
ce704a95
authored
Dec 01, 2017
by
Matija Čupić
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add created? to Cluster model
parent
b7f35360
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
app/models/clusters/cluster.rb
app/models/clusters/cluster.rb
+4
-0
spec/models/clusters/cluster_spec.rb
spec/models/clusters/cluster_spec.rb
+22
-0
No files found.
app/models/clusters/cluster.rb
View file @
ce704a95
...
...
@@ -62,6 +62,10 @@ module Clusters
end
end
def
created?
status_name
==
:created
end
def
applications
[
application_helm
||
build_application_helm
,
...
...
spec/models/clusters/cluster_spec.rb
View file @
ce704a95
...
...
@@ -199,4 +199,26 @@ describe Clusters::Cluster do
end
end
end
describe
'#created?'
do
let
(
:cluster
)
{
create
(
:cluster
,
:provided_by_gcp
)
}
subject
{
cluster
.
created?
}
context
'when status_name is :created'
do
before
do
allow
(
cluster
).
to
receive_message_chain
(
:provider
,
:status_name
).
and_return
(
:created
)
end
it
{
is_expected
.
to
eq
(
true
)
}
end
context
'when status_name is not :created'
do
before
do
allow
(
cluster
).
to
receive_message_chain
(
:provider
,
:status_name
).
and_return
(
:creating
)
end
it
{
is_expected
.
to
eq
(
false
)
}
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