diff options
Diffstat (limited to 'spec/models/clusters')
-rw-r--r-- | spec/models/clusters/applications/ingress_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/clusters/applications/jupyter_spec.rb | 7 | ||||
-rw-r--r-- | spec/models/clusters/applications/knative_spec.rb | 8 | ||||
-rw-r--r-- | spec/models/clusters/cluster_spec.rb | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/clusters/applications/ingress_spec.rb b/spec/models/clusters/applications/ingress_spec.rb index d5fd42509a3..a40fa988287 100644 --- a/spec/models/clusters/applications/ingress_spec.rb +++ b/spec/models/clusters/applications/ingress_spec.rb @@ -56,6 +56,14 @@ describe Clusters::Applications::Ingress do expect(ClusterWaitForIngressIpAddressWorker).not_to have_received(:perform_in) end end + + context 'when there is already an external_hostname' do + let(:application) { create(:clusters_applications_ingress, :installed, external_hostname: 'localhost.localdomain') } + + it 'does not schedule a ClusterWaitForIngressIpAddressWorker' do + expect(ClusterWaitForIngressIpAddressWorker).not_to have_received(:perform_in) + end + end end describe '#install_command' do diff --git a/spec/models/clusters/applications/jupyter_spec.rb b/spec/models/clusters/applications/jupyter_spec.rb index 6e58f3ad699..2967c4076c6 100644 --- a/spec/models/clusters/applications/jupyter_spec.rb +++ b/spec/models/clusters/applications/jupyter_spec.rb @@ -26,6 +26,13 @@ describe Clusters::Applications::Jupyter do it { expect(jupyter).to be_installable } end + + context 'when ingress is installed and external_hostname is assigned' do + let(:ingress) { create(:clusters_applications_ingress, :installed, external_hostname: 'localhost.localdomain') } + let(:jupyter) { create(:clusters_applications_jupyter, cluster: ingress.cluster) } + + it { expect(jupyter).to be_installable } + end end describe '#install_command' do diff --git a/spec/models/clusters/applications/knative_spec.rb b/spec/models/clusters/applications/knative_spec.rb index 4884a5927fb..bf425a2617c 100644 --- a/spec/models/clusters/applications/knative_spec.rb +++ b/spec/models/clusters/applications/knative_spec.rb @@ -64,6 +64,14 @@ describe Clusters::Applications::Knative do expect(ClusterWaitForIngressIpAddressWorker).not_to have_received(:perform_in) end end + + context 'when there is already an external_hostname' do + let(:application) { create(:clusters_applications_knative, :installed, external_hostname: 'localhost.localdomain') } + + it 'does not schedule a ClusterWaitForIngressIpAddressWorker' do + expect(ClusterWaitForIngressIpAddressWorker).not_to have_received(:perform_in) + end + end end shared_examples 'a command' do diff --git a/spec/models/clusters/cluster_spec.rb b/spec/models/clusters/cluster_spec.rb index 3feed4e9718..acbcdc7d170 100644 --- a/spec/models/clusters/cluster_spec.rb +++ b/spec/models/clusters/cluster_spec.rb @@ -31,6 +31,7 @@ describe Clusters::Cluster do it { is_expected.to delegate_method(:available?).to(:application_prometheus).with_prefix } it { is_expected.to delegate_method(:available?).to(:application_knative).with_prefix } it { is_expected.to delegate_method(:external_ip).to(:application_ingress).with_prefix } + it { is_expected.to delegate_method(:external_hostname).to(:application_ingress).with_prefix } it { is_expected.to respond_to :project } |