diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index 051d3c008372e56a9400d1510de15fab46274b26..5ee30deee9d10cf6ae4864a67fe0811b8f466a04 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -60,12 +60,12 @@ class Projects::ClustersController < Projects::ApplicationController .new(project, current_user, cluster_params) .execute(cluster) - if cluster.valid? - flash[:notice] = "Cluster was successfully updated." - redirect_to project_cluster_path(project, project.cluster) - else - render :show - end + if cluster.valid? + flash[:notice] = "Cluster was successfully updated." + redirect_to project_cluster_path(project, project.cluster) + else + render :show + end end def destroy diff --git a/spec/javascripts/fixtures/clusters.rb b/spec/javascripts/fixtures/clusters.rb index be9d1d8f216651e97e1b732f8826b56cb1d322dc..bf8ba8146da7cdcee18ebdfaeb1ca7c9b8fcd5f9 100644 --- a/spec/javascripts/fixtures/clusters.rb +++ b/spec/javascripts/fixtures/clusters.rb @@ -31,5 +31,4 @@ describe Projects::ClustersController, '(JavaScript fixtures)', type: :controlle expect(response).to be_success store_frontend_fixture(response, example.description) end - end diff --git a/spec/models/gcp/cluster_spec.rb b/spec/models/gcp/cluster_spec.rb index cf3036cefce51fe2af2218e1500d445c1836ba95..4b227a19bc2b7507b0d09400502132a05b7218c1 100644 --- a/spec/models/gcp/cluster_spec.rb +++ b/spec/models/gcp/cluster_spec.rb @@ -34,7 +34,7 @@ describe Gcp::Cluster do end context 'when too long' do - let(:gcp_project_id) { 'A'*64 } + let(:gcp_project_id) { 'A' * 64 } it { is_expected.to be_falsey } end @@ -62,7 +62,7 @@ describe Gcp::Cluster do end context 'when too long' do - let(:gcp_cluster_name) { 'A'*64 } + let(:gcp_cluster_name) { 'A' * 64 } it { is_expected.to be_falsey } end @@ -106,7 +106,7 @@ describe Gcp::Cluster do end context 'when too long' do - let(:project_namespace) { 'A'*64 } + let(:project_namespace) { 'A' * 64 } it { is_expected.to be_falsey } end diff --git a/spec/services/ci/create_cluster_service_spec.rb b/spec/services/ci/create_cluster_service_spec.rb index a905ca9895fd424d4a903c5a399dfc82c15a63d9..6e7398fbffa84f89e77597b4f6bd64ea4d05d46e 100644 --- a/spec/services/ci/create_cluster_service_spec.rb +++ b/spec/services/ci/create_cluster_service_spec.rb @@ -13,7 +13,7 @@ describe Ci::CreateClusterService do gcp_project_id: 'gcp-project', gcp_cluster_name: 'test-cluster', gcp_cluster_zone: 'us-central1-a', - gcp_cluster_size: 1, + gcp_cluster_size: 1 } end @@ -34,7 +34,7 @@ describe Ci::CreateClusterService do gcp_project_id: 'gcp-project', gcp_cluster_name: 'test-cluster', gcp_cluster_zone: 'us-central1-a', - gcp_cluster_size: 'ABC', + gcp_cluster_size: 'ABC' } end diff --git a/spec/workers/wait_for_cluster_creation_worker_spec.rb b/spec/workers/wait_for_cluster_creation_worker_spec.rb index eed6bec00f8d60482e4c26ff9bd290a1b43853c3..489dd769c12dcaf013c34c2a6cc5d3a00f5583a4 100644 --- a/spec/workers/wait_for_cluster_creation_worker_spec.rb +++ b/spec/workers/wait_for_cluster_creation_worker_spec.rb @@ -8,7 +8,7 @@ describe WaitForClusterCreationWorker do before do allow(operation).to receive(:status).and_return(status) - allow(operation).to receive(:start_time).and_return(1.minutes.ago) + allow(operation).to receive(:start_time).and_return(1.minute.ago) allow(operation).to receive(:status_message).and_return('error') allow_any_instance_of(Ci::FetchGcpOperationService).to receive(:execute).and_yield(operation) end @@ -17,7 +17,7 @@ describe WaitForClusterCreationWorker do let(:status) { 'RUNNING' } it 'reschedules worker' do - expect(WaitForClusterCreationWorker).to receive(:perform_in) + expect(described_class).to receive(:perform_in) described_class.new.perform(cluster.id) end