Commit 43a9bbce authored by Pawel Chojnacki's avatar Pawel Chojnacki

fix cluster controller spec

parent 8b88b6f2
...@@ -192,7 +192,7 @@ describe Projects::ClustersController do ...@@ -192,7 +192,7 @@ describe Projects::ClustersController do
go go
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response.body).to eq(query_response) expect(response.body).to eq(query_response.to_json)
end end
end end
...@@ -418,8 +418,8 @@ describe Projects::ClustersController do ...@@ -418,8 +418,8 @@ describe Projects::ClustersController do
it "destroys and redirects back to clusters list" do it "destroys and redirects back to clusters list" do
expect { go } expect { go }
.to change { Clusters::Cluster.count }.by(-1) .to change { Clusters::Cluster.count }.by(-1)
.and change { Clusters::Platforms::Kubernetes.count }.by(-1) .and change { Clusters::Platforms::Kubernetes.count }.by(-1)
.and change { Clusters::Providers::Gcp.count }.by(-1) .and change { Clusters::Providers::Gcp.count }.by(-1)
expect(response).to redirect_to(project_clusters_path(project)) expect(response).to redirect_to(project_clusters_path(project))
expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.')
...@@ -432,7 +432,7 @@ describe Projects::ClustersController do ...@@ -432,7 +432,7 @@ describe Projects::ClustersController do
it "destroys and redirects back to clusters list" do it "destroys and redirects back to clusters list" do
expect { go } expect { go }
.to change { Clusters::Cluster.count }.by(-1) .to change { Clusters::Cluster.count }.by(-1)
.and change { Clusters::Providers::Gcp.count }.by(-1) .and change { Clusters::Providers::Gcp.count }.by(-1)
expect(response).to redirect_to(project_clusters_path(project)) expect(response).to redirect_to(project_clusters_path(project))
expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.')
...@@ -446,8 +446,8 @@ describe Projects::ClustersController do ...@@ -446,8 +446,8 @@ describe Projects::ClustersController do
it "destroys and redirects back to clusters list" do it "destroys and redirects back to clusters list" do
expect { go } expect { go }
.to change { Clusters::Cluster.count }.by(-1) .to change { Clusters::Cluster.count }.by(-1)
.and change { Clusters::Platforms::Kubernetes.count }.by(-1) .and change { Clusters::Platforms::Kubernetes.count }.by(-1)
.and change { Clusters::Providers::Gcp.count }.by(0) .and change { Clusters::Providers::Gcp.count }.by(0)
expect(response).to redirect_to(project_clusters_path(project)) expect(response).to redirect_to(project_clusters_path(project))
expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.') expect(flash[:notice]).to eq('Kubernetes cluster integration was successfully removed.')
...@@ -470,8 +470,8 @@ describe Projects::ClustersController do ...@@ -470,8 +470,8 @@ describe Projects::ClustersController do
def go def go
delete :destroy, namespace_id: project.namespace, delete :destroy, namespace_id: project.namespace,
project_id: project, project_id: project,
id: cluster id: cluster
end end
end end
end end
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