diff options
Diffstat (limited to 'spec/services/clusters/parse_cluster_applications_artifact_service_spec.rb')
-rw-r--r-- | spec/services/clusters/parse_cluster_applications_artifact_service_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/services/clusters/parse_cluster_applications_artifact_service_spec.rb b/spec/services/clusters/parse_cluster_applications_artifact_service_spec.rb index f14c929554a..bb0b107eba6 100644 --- a/spec/services/clusters/parse_cluster_applications_artifact_service_spec.rb +++ b/spec/services/clusters/parse_cluster_applications_artifact_service_spec.rb @@ -85,13 +85,25 @@ describe Clusters::ParseClusterApplicationsArtifactService do end end - context 'job has no deployment cluster' do + context 'job has no deployment' do let(:job) { build(:ci_build) } it 'returns an error' do result = described_class.new(job, user).execute(artifact) expect(result[:status]).to eq(:error) + expect(result[:message]).to eq('No deployment found for this job') + end + end + + context 'job has no deployment cluster' do + let(:deployment) { create(:deployment) } + let(:job) { deployment.deployable } + + it 'returns an error' do + result = described_class.new(job, user).execute(artifact) + + expect(result[:status]).to eq(:error) expect(result[:message]).to eq('No deployment cluster found for this job') end end |