Sha256: 46ec6c276ebc650d7212d1d7e6acc769ab0abde4f8d53241da282244d70f4e57

Contents?: true

Size: 1.07 KB

Versions: 13

Compression:

Stored size: 1.07 KB

Contents

# frozen_string_literal: true

require 'test_plugin_helper'

module ForemanAcd
  # ACD Provider Test
  class AcdProviderTest < ActiveSupport::TestCase
    describe '.provider_names' do
      let(:provider_names) { AcdProvider.provider_names }

      it 'returns only strings' do
        provider_names.each do |name|
          _(name).must_be_kind_of String
        end
      end

      context 'provider is registetered under :custom symbol' do
        before { AcdProvider.register(:ACD, String) }
        it { _(provider_names).must_include 'ACD' }
      end
    end

    describe AcdProvider do
      before { User.current = FactoryBot.build(:user, :admin) }
      after { User.current = nil }

      before do
        Setting::RemoteExecution.load_defaults
      end

      let(:job_invocation) { FactoryBot.create(:job_invocation, :with_template) }
      let(:template_invocation) { job_invocation.pattern_template_invocations.first }
      let(:host) { FactoryBot.create(:host) }
      let(:proxy_options) { AcdProvider.proxy_command_options(template_invocation, host) }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
foreman_acd-0.11.0 test/models/acd_provider_test.rb
foreman_acd-0.10.0 test/models/acd_provider_test.rb
foreman_acd-0.9.7 test/models/acd_provider_test.rb
foreman_acd-0.9.5 test/models/acd_provider_test.rb
foreman_acd-0.9.4 test/models/acd_provider_test.rb
foreman_acd-0.9.3 test/models/acd_provider_test.rb
foreman_acd-0.9.2.3 test/models/acd_provider_test.rb
foreman_acd-0.9.2.2 test/models/acd_provider_test.rb
foreman_acd-0.9.2.1 test/models/acd_provider_test.rb
foreman_acd-0.9.2 test/models/acd_provider_test.rb
foreman_acd-0.9.1 test/models/acd_provider_test.rb
foreman_acd-0.9.0 test/models/acd_provider_test.rb
foreman_acd-0.7.0 test/models/acd_provider_test.rb