Sha256: 67af17adea2f84afbf670eb9316b706368f3812418555708723f0d6b2169eee5

Contents?: true

Size: 1.15 KB

Versions: 8

Compression:

Stored size: 1.15 KB

Contents

# This calls the main test_helper in Foreman-core
require 'test_helper'

# Add plugin to FactoryBot's paths
FactoryBot.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
# FactoryBot.definition_file_paths << "#{Katello::Engine.root}/test/factories"
FactoryBot.reload

module FolderIsolation
  extend ActiveSupport::Concern

  included do
    setup do
      @tmpdir = Dir.mktmpdir(self.class.name.underscore)

      ForemanInventoryUpload.stubs(:base_folder).returns(@tmpdir)
      ForemanInventoryUpload.instance_variable_set(:@outputs_folder, nil)
      ForemanInventoryUpload.instance_variable_set(:@uploads_folders, nil)
    end

    teardown do
      FileUtils.remove_entry @tmpdir
      ForemanInventoryUpload.unstub(:base_folder)
    end
  end
end

module KatelloLocationFix
  extend ActiveSupport::Concern

  included do
    setup do
      FactoryBot.create(:setting, name: 'default_location_subscribed_hosts')
      FactoryBot.create(:setting, name: 'default_location_puppet_content')
      Setting[:default_location_subscribed_hosts] = Location.first.title
      Setting[:default_location_puppet_content] = Location.first.title
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman_rh_cloud-3.0.22 test/test_plugin_helper.rb
foreman_rh_cloud-4.0.21.1 test/test_plugin_helper.rb
foreman_rh_cloud-3.0.21.1 test/test_plugin_helper.rb
foreman_rh_cloud-3.0.21 test/test_plugin_helper.rb
foreman_rh_cloud-3.0.20 test/test_plugin_helper.rb
foreman_rh_cloud-3.0.19 test/test_plugin_helper.rb
foreman_rh_cloud-3.0.18.1 test/test_plugin_helper.rb
foreman_rh_cloud-3.0.18 test/test_plugin_helper.rb