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
54831bd4
Commit
54831bd4
authored
Oct 04, 2017
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated messages and notices
parent
f16ac0ef
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
33 deletions
+4
-33
app/controllers/projects/clusters_controller.rb
app/controllers/projects/clusters_controller.rb
+3
-3
app/models/gcp/cluster.rb
app/models/gcp/cluster.rb
+0
-4
spec/models/gcp/cluster_spec.rb
spec/models/gcp/cluster_spec.rb
+0
-26
spec/models/project_spec.rb
spec/models/project_spec.rb
+1
-0
No files found.
app/controllers/projects/clusters_controller.rb
View file @
54831bd4
...
@@ -61,7 +61,7 @@ class Projects::ClustersController < Projects::ApplicationController
...
@@ -61,7 +61,7 @@ class Projects::ClustersController < Projects::ApplicationController
.
execute
(
cluster
)
.
execute
(
cluster
)
if
cluster
.
valid?
if
cluster
.
valid?
flash
[
:notice
]
=
"Cluster
updated
"
flash
[
:notice
]
=
"Cluster
was successfully updated.
"
redirect_to
project_cluster_path
(
project
,
project
.
cluster
)
redirect_to
project_cluster_path
(
project
,
project
.
cluster
)
else
else
render
:show
render
:show
...
@@ -70,10 +70,10 @@ class Projects::ClustersController < Projects::ApplicationController
...
@@ -70,10 +70,10 @@ class Projects::ClustersController < Projects::ApplicationController
def
destroy
def
destroy
if
cluster
.
destroy
if
cluster
.
destroy
flash
[
:notice
]
=
"Cluster
removed
"
flash
[
:notice
]
=
"Cluster
was successfully removed.
"
redirect_to
project_clusters_path
(
project
),
status:
302
redirect_to
project_clusters_path
(
project
),
status:
302
else
else
flash
[
:notice
]
=
"Cluster
removed
"
flash
[
:notice
]
=
"Cluster
was not removed.
"
render
:show
render
:show
end
end
end
end
...
...
app/models/gcp/cluster.rb
View file @
54831bd4
...
@@ -110,9 +110,5 @@ module Gcp
...
@@ -110,9 +110,5 @@ module Gcp
true
true
end
end
def
destroy
super
if
restrict_modification
end
end
end
end
end
spec/models/gcp/cluster_spec.rb
View file @
54831bd4
...
@@ -237,30 +237,4 @@ describe Gcp::Cluster do
...
@@ -237,30 +237,4 @@ describe Gcp::Cluster do
end
end
end
end
end
end
describe
'#destroy'
do
subject
{
cluster
.
destroy
}
let
(
:cluster
)
{
create
(
:gcp_cluster
)
}
context
'when status is created'
do
before
do
cluster
.
make_created!
end
it
'destory the cluster'
do
is_expected
.
to
eq
(
cluster
)
end
end
context
'when status is creating'
do
before
do
cluster
.
make_creating!
end
it
'does not destory the cluster'
do
is_expected
.
to
be_nil
end
end
end
end
end
spec/models/project_spec.rb
View file @
54831bd4
...
@@ -76,6 +76,7 @@ describe Project do
...
@@ -76,6 +76,7 @@ describe Project do
it
{
is_expected
.
to
have_many
(
:uploads
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_many
(
:uploads
).
dependent
(
:destroy
)
}
it
{
is_expected
.
to
have_many
(
:pipeline_schedules
)
}
it
{
is_expected
.
to
have_many
(
:pipeline_schedules
)
}
it
{
is_expected
.
to
have_many
(
:members_and_requesters
)
}
it
{
is_expected
.
to
have_many
(
:members_and_requesters
)
}
it
{
is_expected
.
to
have_one
(
:cluster
)
}
context
'after initialized'
do
context
'after initialized'
do
it
"has a project_feature"
do
it
"has a project_feature"
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