summaryrefslogtreecommitdiff
path: root/spec/services/clusters/applications/create_service_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/clusters/applications/create_service_spec.rb')
-rw-r--r--spec/services/clusters/applications/create_service_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/services/clusters/applications/create_service_spec.rb b/spec/services/clusters/applications/create_service_spec.rb
index 1a2ca23748a..3f621ed5944 100644
--- a/spec/services/clusters/applications/create_service_spec.rb
+++ b/spec/services/clusters/applications/create_service_spec.rb
@@ -13,6 +13,7 @@ describe Clusters::Applications::CreateService do
describe '#execute' do
before do
allow(ClusterInstallAppWorker).to receive(:perform_async)
+ allow(ClusterUpgradeAppWorker).to receive(:perform_async)
end
subject { service.execute(test_request) }
@@ -31,6 +32,22 @@ describe Clusters::Applications::CreateService do
subject
end
+ context 'application already installed' do
+ let!(:application) { create(:clusters_applications_helm, :installed, cluster: cluster) }
+
+ it 'does not create a new application' do
+ expect do
+ subject
+ end.not_to change(Clusters::Applications::Helm, :count)
+ end
+
+ it 'schedules an upgrade for the application' do
+ expect(Clusters::Applications::ScheduleInstallationService).to receive(:new).with(application).and_call_original
+
+ subject
+ end
+ end
+
context 'cert manager application' do
let(:params) do
{