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-13.0.2 test/test_plugin_helper.rb
foreman_ansible-13.0.1 test/test_plugin_helper.rb
foreman_ansible-13.0.0 test/test_plugin_helper.rb
foreman_ansible-12.0.7 test/test_plugin_helper.rb
foreman_ansible-10.4.4 test/test_plugin_helper.rb
foreman_ansible-7.1.8 test/test_plugin_helper.rb
foreman_ansible-12.0.6 test/test_plugin_helper.rb
foreman_ansible-12.0.5 test/test_plugin_helper.rb
foreman_ansible-10.4.3 test/test_plugin_helper.rb
foreman_ansible-12.0.4 test/test_plugin_helper.rb
foreman_ansible-10.4.2 test/test_plugin_helper.rb
foreman_ansible-12.0.3 test/test_plugin_helper.rb
foreman_ansible-12.0.2 test/test_plugin_helper.rb
foreman_ansible-12.0.1 test/test_plugin_helper.rb
foreman_ansible-12.0.0 test/test_plugin_helper.rb
foreman_ansible-11.2.1 test/test_plugin_helper.rb
foreman_ansible-7.1.7 test/test_plugin_helper.rb
foreman_ansible-11.2.0 test/test_plugin_helper.rb
foreman_ansible-11.1.2 test/test_plugin_helper.rb
foreman_ansible-7.1.6 test/test_plugin_helper.rb