Sha256: ad5dcef5f51f5dccb05cedb506028c43ffca7d33311628ac0f37baf39b51085c
Contents?: true
Size: 1020 Bytes
Versions: 23
Compression:
Stored size: 1020 Bytes
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 FactoryBot.create(:setting, :name => 'allow_auto_inventory_upload', :settings_type => "boolean", :category => "Setting::RhCloud", :default => false, :value => true) InventorySync::Async::InventoryScheduledSync.any_instance.expects(:plan_org_sync).times(Organization.unscoped.count) ForemanTasks.sync_task(InventorySync::Async::InventoryScheduledSync) end test 'Skips execution if auto upload is disabled' do FactoryBot.create(:setting, :name => 'allow_auto_inventory_upload', :settings_type => "boolean", :category => "Setting::RhCloud", :default => false, :value => false) InventorySync::Async::InventoryScheduledSync.any_instance.expects(:plan_org_sync).never ForemanTasks.sync_task(InventorySync::Async::InventoryScheduledSync) end end
Version data entries
23 entries across 23 versions & 1 rubygems