Sha256: 53d74576798510755d6a99e2c913c57ccb465dfb943d920cb810ca109496ab6e
Contents?: true
Size: 1.44 KB
Versions: 17
Compression:
Stored size: 1.44 KB
Contents
require 'test_plugin_helper' require 'foreman_tasks/test_helpers' class UploadReportJobTest < ActiveSupport::TestCase include ForemanTasks::TestHelpers::WithInThreadExecutor include FolderIsolation test 'returns aborted state when disconnected' do organization = FactoryBot.create(:organization) Organization.any_instance.stubs(:owner_details).returns( 'upstreamConsumer' => { 'idCert' => 'TEST_CERT', } ) Setting[:content_disconnected] = true ForemanTasks.sync_task(ForemanInventoryUpload::Async::UploadReportJob, '', organization.id) label = ForemanInventoryUpload::Async::UploadReportJob.output_label(organization.id) progress_output = ForemanInventoryUpload::Async::ProgressOutput.get(label) assert_match(/Upload was stopped/, progress_output.full_output) assert_match(/exit 1/, progress_output.status) end test 'returns aborted state when no certificate defined on organization' do organization = FactoryBot.create(:organization) Organization.any_instance.expects(:owner_details).returns(nil) ForemanTasks.sync_task(ForemanInventoryUpload::Async::UploadReportJob, '', organization.id) label = ForemanInventoryUpload::Async::UploadReportJob.output_label(organization.id) progress_output = ForemanInventoryUpload::Async::ProgressOutput.get(label) assert_match(/Skipping organization/, progress_output.full_output) assert_match(/exit 1/, progress_output.status) end end
Version data entries
17 entries across 17 versions & 1 rubygems