Rename spec local variable to avoid shadowing
This commit is contained in:
parent
42d87f9085
commit
f6057437dc
1 changed files with 5 additions and 8 deletions
|
@ -16,10 +16,7 @@ describe Projects::ClustersController do
|
||||||
context 'when project has one or more clusters' do
|
context 'when project has one or more clusters' do
|
||||||
let(:project) { create(:project) }
|
let(:project) { create(:project) }
|
||||||
let(:clusters) { create_list(:cluster, 2, :provided_by_gcp, projects: [project]) }
|
let(:clusters) { create_list(:cluster, 2, :provided_by_gcp, projects: [project]) }
|
||||||
|
let(:inactive_cluster) { create(:cluster, :provided_by_gcp, projects: [project]) }
|
||||||
before do
|
|
||||||
clusters.last.enabled = false
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'lists available clusters' do
|
it 'lists available clusters' do
|
||||||
go
|
go
|
||||||
|
@ -56,16 +53,16 @@ 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, project_id: project, scope: 'active'
|
get :index, namespace_id: project.namespace, project_id: project, scope: 'active'
|
||||||
clusters = assigns(:clusters)
|
view_clusters = assigns(:clusters)
|
||||||
expect(clusters.all? { |cluster| cluster.enabled == true }).to eq(true)
|
expect(view_clusters.all? { |cluster| cluster.enabled == true }).to eq(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
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, project_id: project, scope: 'inactive'
|
get :index, namespace_id: project.namespace, project_id: project, scope: 'inactive'
|
||||||
clusters = assigns(:clusters)
|
view_clusters = assigns(:clusters)
|
||||||
expect(clusters.all? { |cluster| cluster.enabled == false }).to eq(true)
|
expect(view_clusters.all? { |cluster| cluster.enabled == false }).to eq(true)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue