summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2017-10-04 21:10:08 +0200
committerKamil Trzcinski <ayufan@ayufan.eu>2017-10-04 21:10:08 +0200
commit54831bd44bdf7f7b19ac3a129ebf6384549d9c63 (patch)
tree176993bcaddc37494e56456ea00bc4d0199b328b
parentf16ac0efda68cfb6819e784dbec5609b10e8de7d (diff)
downloadgitlab-ce-54831bd44bdf7f7b19ac3a129ebf6384549d9c63.tar.gz
Updated messages and notices
-rw-r--r--app/controllers/projects/clusters_controller.rb6
-rw-r--r--app/models/gcp/cluster.rb4
-rw-r--r--spec/models/gcp/cluster_spec.rb26
-rw-r--r--spec/models/project_spec.rb1
4 files changed, 4 insertions, 33 deletions
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb
index 46118184993..051d3c00837 100644
--- a/app/controllers/projects/clusters_controller.rb
+++ b/app/controllers/projects/clusters_controller.rb
@@ -61,7 +61,7 @@ class Projects::ClustersController < Projects::ApplicationController
.execute(cluster)
if cluster.valid?
- flash[:notice] = "Cluster updated"
+ flash[:notice] = "Cluster was successfully updated."
redirect_to project_cluster_path(project, project.cluster)
else
render :show
@@ -70,10 +70,10 @@ class Projects::ClustersController < Projects::ApplicationController
def destroy
if cluster.destroy
- flash[:notice] = "Cluster removed"
+ flash[:notice] = "Cluster was successfully removed."
redirect_to project_clusters_path(project), status: 302
else
- flash[:notice] = "Cluster removed"
+ flash[:notice] = "Cluster was not removed."
render :show
end
end
diff --git a/app/models/gcp/cluster.rb b/app/models/gcp/cluster.rb
index 367e9be578c..f570c8b3c4c 100644
--- a/app/models/gcp/cluster.rb
+++ b/app/models/gcp/cluster.rb
@@ -110,9 +110,5 @@ module Gcp
true
end
-
- def destroy
- super if restrict_modification
- end
end
end
diff --git a/spec/models/gcp/cluster_spec.rb b/spec/models/gcp/cluster_spec.rb
index 5e4c35e24ff..cf3036cefce 100644
--- a/spec/models/gcp/cluster_spec.rb
+++ b/spec/models/gcp/cluster_spec.rb
@@ -237,30 +237,4 @@ describe Gcp::Cluster do
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
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb
index 176bb568cbe..e62bfaf22ba 100644
--- a/spec/models/project_spec.rb
+++ b/spec/models/project_spec.rb
@@ -76,6 +76,7 @@ describe Project do
it { is_expected.to have_many(:uploads).dependent(:destroy) }
it { is_expected.to have_many(:pipeline_schedules) }
it { is_expected.to have_many(:members_and_requesters) }
+ it { is_expected.to have_one(:cluster) }
context 'after initialized' do
it "has a project_feature" do