Commit 4c2a33ce authored by Shinya Maeda's avatar Shinya Maeda

Fix clusters_controller_spec

parent 37ca748c
......@@ -18,7 +18,7 @@ describe Projects::ClustersController do
context 'when project has one or more clusters' do
let(:project) { create(:project) }
let!(:enabled_cluster) { create(:cluster, :provided_by_gcp, projects: [project]) }
let!(:disabled_cluster) { create(:cluster, :disabled, :provided_by_gcp, projects: [project]) }
let!(:disabled_cluster) { create(:cluster, :disabled, :provided_by_gcp, environment_scope: 'prod/*', projects: [project]) }
it 'lists available clusters' do
go
......@@ -32,7 +32,8 @@ describe Projects::ClustersController do
before do
allow(Clusters::Cluster).to receive(:paginates_per).and_return(1)
create_list(:cluster, 2, :provided_by_gcp, projects: [project])
create(:cluster, :provided_by_gcp, environment_scope: 'staging/*', projects: [project])
create(:cluster, :provided_by_gcp, environment_scope: 'review/*', projects: [project])
get :index, namespace_id: project.namespace, project_id: project, page: last_page
end
......@@ -370,7 +371,7 @@ describe Projects::ClustersController do
end
describe 'security' do
set(:cluster) { create(:cluster, :provided_by_gcp, projects: [project]) }
let(:cluster) { create(:cluster, :provided_by_gcp, projects: [project]) }
it { expect { go }.to be_allowed_for(:admin) }
it { expect { go }.to be_allowed_for(:owner).of(project) }
......
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