Sha256: 35f74f1c15583fb0ada69372d35584252c93f6c30c9dfeea6f3f76840cbcd72c

Contents?: true

Size: 1.02 KB

Versions: 4

Compression:

Stored size: 1.02 KB

Contents

require 'test_plugin_helper'

module ForemanSalt
  class HostExtensionsTest < ActiveSupport::TestCase
    setup do
      User.current = User.find_by_login 'admin'
    end

    test 'host has a salt smart proxy' do
      host = FactoryGirl.create :host, :with_salt_proxy
      assert host.salt_proxy.features.map(&:name).include? 'Salt'
    end

    test 'smart_proxy_ids returns salt smart proxy' do
      host = FactoryGirl.create :host, :with_salt_proxy
      assert host.smart_proxy_ids.include? host.salt_proxy_id
    end

    test 'host params includes salt_master' do
      host = FactoryGirl.create :host, :with_salt_proxy
      assert host.params.key? 'salt_master'
      assert_equal host.params['salt_master'], host.salt_master
    end

    test 'host inherits salt proxy from host group' do
      hostgroup = FactoryGirl.create :hostgroup, :with_salt_proxy
      host = FactoryGirl.create :host, :hostgroup => hostgroup
      host.set_hostgroup_defaults
      assert_equal host.salt_proxy, hostgroup.salt_proxy
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_salt-2.0.2 test/unit/host_extensions_test.rb
foreman_salt-2.0.1 test/unit/host_extensions_test.rb
foreman_salt-2.0.0 test/unit/host_extensions_test.rb
foreman_salt-1.1.1 test/unit/host_extensions_test.rb