Sha256: ee4043d97ef67202867e84875e5169e1f8ea082d42a56fa04ff47581030d5411

Contents?: true

Size: 827 Bytes

Versions: 7

Compression:

Stored size: 827 Bytes

Contents

require 'test_helper'
require 'mocha/setup'

class BindingsTest < ActiveSupport::TestCase

  def setup
    KatelloForemanEngine::Settings.initialize_settings
  end

  test 'client lib setting' do
    KatelloForemanEngine::Settings['foreman_url'] = 'https://example.com/foreman'
    KatelloForemanEngine::Settings['oauth_consumer_key'] = 'key'
    KatelloForemanEngine::Settings['oauth_consumer_secret'] = 'secret'
    User.current = User.new(:username => 'test')
    env_resource = KatelloForemanEngine::Bindings.environment
    config = env_resource.config
    assert_equal 'https://example.com/foreman', config[:base_url]
    assert_equal 'key', config[:oauth][:consumer_key]
    assert_equal 'secret', config[:oauth][:consumer_secret]
    assert_equal 'test', env_resource.client.options[:headers][:foreman_user]
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katello-foreman-engine-0.0.12 test/lib/bindings_test.rb
katello-foreman-engine-0.0.11 test/lib/bindings_test.rb
katello-foreman-engine-0.0.7 test/lib/bindings_test.rb
katello-foreman-engine-0.0.6 test/lib/bindings_test.rb
katello-foreman-engine-0.0.3 test/lib/bindings_test.rb
katello-foreman-engine-0.0.2 test/lib/bindings_test.rb
katello-foreman-engine-0.0.1 test/lib/bindings_test.rb