Commit 62b52a46 authored by Ryan Cobb's avatar Ryan Cobb

Refactor cluster metric dashboard specs

This refactors cluster metric dashboard specs by extracting some of the
shared examples into their appropriate admin/project/group spec.
parent 2786d418
...@@ -48,6 +48,16 @@ describe Admin::ClustersController do ...@@ -48,6 +48,16 @@ describe Admin::ClustersController do
end end
end end
end end
describe 'GET #metrics_dashboard' do
let(:user) { create(:admin) }
before do
sign_in(user)
end
it_behaves_like 'the default dashboard'
end
end end
private private
......
...@@ -78,6 +78,17 @@ describe Groups::ClustersController do ...@@ -78,6 +78,17 @@ describe Groups::ClustersController do
it { expect { go }.to be_denied_for(:user) } it { expect { go }.to be_denied_for(:user) }
it { expect { go }.to be_denied_for(:external) } it { expect { go }.to be_denied_for(:external) }
end end
describe 'GET #metrics_dashboard' do
let(:user) { create(:user) }
before do
clusterable.add_maintainer(user)
sign_in(user)
end
it_behaves_like 'the default dashboard'
end
end end
private private
......
...@@ -70,6 +70,17 @@ describe Projects::ClustersController do ...@@ -70,6 +70,17 @@ describe Projects::ClustersController do
it { expect { go }.to be_denied_for(:user) } it { expect { go }.to be_denied_for(:user) }
it { expect { go }.to be_denied_for(:external) } it { expect { go }.to be_denied_for(:external) }
end end
describe 'GET #metrics_dashboard' do
let(:user) { create(:user) }
before do
clusterable.add_maintainer(user)
sign_in(user)
end
it_behaves_like 'the default dashboard'
end
end end
private private
......
...@@ -186,13 +186,6 @@ shared_examples 'cluster metrics' do ...@@ -186,13 +186,6 @@ shared_examples 'cluster metrics' do
end end
end end
end end
describe 'GET #metrics_dashboard' do
let(:user) { create(:user) }
before do
clusterable.add_maintainer(user)
sign_in(user)
end end
shared_examples_for 'correctly formatted response' do |status_code| shared_examples_for 'correctly formatted response' do |status_code|
...@@ -236,10 +229,6 @@ shared_examples 'cluster metrics' do ...@@ -236,10 +229,6 @@ shared_examples 'cluster metrics' do
end end
end end
it_behaves_like 'the default dashboard'
end
end
private private
def go def go
......
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