Sha256: 5f2b1a15ccba291f0d3175625b0f361a1bcc0ed271ed4bc34abf3fa6ac02682b

Contents?: true

Size: 1.46 KB

Versions: 3

Compression:

Stored size: 1.46 KB

Contents

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

# Add plugin to FactoryGirl's paths
FactoryGirl.definition_file_paths << File.join(File.dirname(__FILE__), 'factories')
FactoryGirl.reload

Spork.each_run do
  class ActionController::TestCase
    setup :add_smart_proxy

    private

    def add_smart_proxy
      FactoryGirl.create(:smart_proxy, :url => 'http://localhost:8443', :features => [FactoryGirl.create(:feature, :name => 'Openscap')])
      ::ProxyAPI::Features.any_instance.stubs(:features).returns(%w(puppet openscap))
      ProxyAPI::Openscap.any_instance.stubs(:validate_scap_content).returns({'errors' => []})
      ProxyAPI::Openscap.any_instance.stubs(:fetch_policies_for_scap_content)
          .returns({'xccdf_org.ssgproject.content_profile_common' => 'Common Profile for General-Purpose Fedora Systems'})
    end
  end

  class ActiveSupport::TestCase
    setup :add_smart_proxy

    private

    def add_smart_proxy
      FactoryGirl.create(:smart_proxy, :url => 'http://localhost:8443', :features => [FactoryGirl.create(:feature, :name => 'Openscap')])
      ::ProxyAPI::Features.any_instance.stubs(:features).returns(%w(puppet openscap))
      ProxyAPI::Openscap.any_instance.stubs(:validate_scap_content).returns({'errors' => []})
      ProxyAPI::Openscap.any_instance.stubs(:fetch_policies_for_scap_content)
          .returns({'xccdf_org.ssgproject.content_profile_common' => 'Common Profile for General-Purpose Fedora Systems'})
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
foreman_openscap-0.5.3 test/test_plugin_helper.rb
foreman_openscap-0.5.2 test/test_plugin_helper.rb
foreman_openscap-0.5.1 test/test_plugin_helper.rb