Sha256: f15d533a0541128ba0c6eeef1180b6b959f715121860d49bf03c748d369a961e

Contents?: true

Size: 966 Bytes

Versions: 91

Compression:

Stored size: 966 Bytes

Contents

# frozen_string_literal: true

require 'test_helper'
require 'facets'

def ansible_fixture_file(filename)
  File.join(
    ForemanAnsible::Engine.root, 'test', 'fixtures', filename
  )
end

def sample_facts_file
  File.read(
    ansible_fixture_file('sample_facts.json')
  )
end

def facts_json
  HashWithIndifferentAccess.new(JSON.parse(sample_facts_file))
end

def assert_job_invocation_is_ok(response, targets)
  as_admin do
    targeting = JobInvocation.find(response['id']).targeting
    targeting.resolve_hosts!
    assert_equal [targets].flatten.sort, targeting.hosts.map(&:id).sort
  end
  assert_equal 'Ansible Playbook', response['job_category']
  assert_response :created
end
plugin_factories_path = File.join(File.dirname(__FILE__), 'factories')
rex_factories_path = "#{ForemanRemoteExecution::Engine.root}/test/factories"
FactoryBot.definition_file_paths << rex_factories_path
FactoryBot.definition_file_paths << plugin_factories_path
FactoryBot.reload

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
foreman_ansible-7.1.0 test/test_plugin_helper.rb
foreman_ansible-7.0.3 test/test_plugin_helper.rb
foreman_ansible-7.0.2 test/test_plugin_helper.rb
foreman_ansible-7.0.1 test/test_plugin_helper.rb
foreman_ansible-7.0.0 test/test_plugin_helper.rb
foreman_ansible-6.3.4 test/test_plugin_helper.rb
foreman_ansible-6.3.3 test/test_plugin_helper.rb
foreman_ansible-6.3.2 test/test_plugin_helper.rb
foreman_ansible-6.3.1 test/test_plugin_helper.rb
foreman_ansible-6.4.1 test/test_plugin_helper.rb
foreman_ansible-6.4.0 test/test_plugin_helper.rb
foreman_ansible-6.3.0 test/test_plugin_helper.rb
foreman_ansible-6.2.0 test/test_plugin_helper.rb
foreman_ansible-6.1.1 test/test_plugin_helper.rb
foreman_ansible-6.0.2 test/test_plugin_helper.rb
foreman_ansible-6.1.0 test/test_plugin_helper.rb
foreman_ansible-6.0.1 test/test_plugin_helper.rb
foreman_ansible-5.1.3 test/test_plugin_helper.rb
foreman_ansible-6.0.0 test/test_plugin_helper.rb
foreman_ansible-5.1.2 test/test_plugin_helper.rb