BigW Consortium Gitlab

Update ClustersController to match new scope logic

parent 3de1ba6c
...@@ -26,7 +26,7 @@ describe Projects::ClustersController do ...@@ -26,7 +26,7 @@ describe Projects::ClustersController do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template(:index) expect(response).to render_template(:index)
expect(assigns(:clusters)).to eq(clusters) expect(assigns(:clusters)).to match_array(clusters)
end end
it 'assigns counters to correct values' do it 'assigns counters to correct values' do
...@@ -48,7 +48,7 @@ describe Projects::ClustersController do ...@@ -48,7 +48,7 @@ describe Projects::ClustersController do
context 'when only enabled clusters are requested' do context 'when only enabled clusters are requested' do
it 'returns only enabled clusters' do it 'returns only enabled clusters' do
get :index, namespace_id: project.namespace.to_param, project_id: project, scope: 'enabled' get :index, namespace_id: project.namespace.to_param, project_id: project, scope: 'active'
clusters = assigns(:clusters) clusters = assigns(:clusters)
expect(clusters.all? { |cluster| cluster.enabled == true }).to eq(true) expect(clusters.all? { |cluster| cluster.enabled == true }).to eq(true)
end end
...@@ -56,7 +56,7 @@ describe Projects::ClustersController do ...@@ -56,7 +56,7 @@ describe Projects::ClustersController do
context 'when only disabled clusters are requested' do context 'when only disabled clusters are requested' do
it 'returns only disabled clusters' do it 'returns only disabled clusters' do
get :index, namespace_id: project.namespace.to_param, project_id: project, scope: 'disabled' get :index, namespace_id: project.namespace.to_param, project_id: project, scope: 'inactive'
clusters = assigns(:clusters) clusters = assigns(:clusters)
expect(clusters.all? { |cluster| cluster.enabled == false }).to eq(true) expect(clusters.all? { |cluster| cluster.enabled == false }).to eq(true)
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