Commit 54831bd4 authored by Kamil Trzcinski's avatar Kamil Trzcinski

Updated messages and notices

parent f16ac0ef
...@@ -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
......
...@@ -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
...@@ -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
...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment