Spec: applications not yet installed doesn't count

We should not consider an application that is not yet installed or where
the install errored as available. Write a spec to assert this
This commit is contained in:
Thong Kuah 2019-02-15 12:41:10 +13:00
parent 9eeca2db6d
commit 4e5494081e
1 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,14 @@ describe Prometheus::AdapterService do
context "prometheus service can't execute queries" do
let(:prometheus_service) { double(:prometheus_service, can_query?: false) }
context 'with cluster with prometheus not yet installed' do
let!(:prometheus) { create(:clusters_applications_prometheus, :installable, cluster: cluster) }
it 'returns nil' do
expect(subject.prometheus_adapter).to be_nil
end
end
context 'with cluster with prometheus installed' do
let!(:prometheus) { create(:clusters_applications_prometheus, :installed, cluster: cluster) }