Sha256: b0072cb9ade72a62b03ce7f4fc6e49d9b4e0edf8625d639b6e3c6384993a7b07
Contents?: true
Size: 1.42 KB
Versions: 22
Compression:
Stored size: 1.42 KB
Contents
require 'test_plugin_helper' require 'foreman_tasks/test_helpers' class InventoryScheduledSyncTest < ActiveSupport::TestCase include ForemanTasks::TestHelpers::WithInThreadExecutor test 'Schedules an execution if auto upload is enabled' do Setting[:allow_auto_inventory_upload] = true Setting[:allow_auto_insights_mismatch_delete] = true InventorySync::Async::InventoryScheduledSync.any_instance.expects(:plan_org_sync).times(Organization.unscoped.count) InventorySync::Async::InventoryScheduledSync.any_instance.expects(:plan_remove_insights_hosts).times(Organization.unscoped.count) ForemanTasks.sync_task(InventorySync::Async::InventoryScheduledSync) end test 'Skips execution if auto upload is disabled' do Setting[:allow_auto_inventory_upload] = false InventorySync::Async::InventoryScheduledSync.any_instance.expects(:plan_org_sync).never ForemanTasks.sync_task(InventorySync::Async::InventoryScheduledSync) end test 'Skips mismatch deletion if the setting is disabled' do Setting[:allow_auto_inventory_upload] = true Setting[:allow_auto_insights_mismatch_delete] = false InventorySync::Async::InventoryScheduledSync.any_instance.expects(:plan_org_sync).times(Organization.unscoped.count) InventorySync::Async::InventoryScheduledSync.any_instance.expects(:plan_remove_insights_hosts).never ForemanTasks.sync_task(InventorySync::Async::InventoryScheduledSync) end end
Version data entries
22 entries across 22 versions & 1 rubygems