Sha256: ec76aa4ca08663dd1d5f4e2711738674485c19527f0f61d62e9ed5b750afcf42
Contents?: true
Size: 1.56 KB
Versions: 4
Compression:
Stored size: 1.56 KB
Contents
require 'test_plugin_helper' module ForemanSalt class HostgroupExtensionsTest < ActiveSupport::TestCase setup do User.current = User.find_by_login 'admin' end test 'host group has a salt smart proxy' do hostgroup = FactoryGirl.create :hostgroup, :with_salt_proxy assert hostgroup.salt_proxy.features.map(&:name).include? 'Salt' end test 'nested host group inherits salt modules from parent' do parent = FactoryGirl.create :hostgroup, :with_salt_modules child = FactoryGirl.create :hostgroup, :parent => parent assert_equal [], parent.salt_modules - child.salt_modules end test 'child host group inherits salt proxy from child parent' do parent = FactoryGirl.create :hostgroup child_one = FactoryGirl.create :hostgroup, :with_salt_proxy, :parent => parent child_two = FactoryGirl.create :hostgroup, :parent => child_one assert_equal child_two.salt_proxy, child_one.salt_proxy end test 'child and parent salt modules are combined' do parent = FactoryGirl.create :hostgroup, :with_salt_modules child = FactoryGirl.create :hostgroup, :with_salt_modules, :parent => parent assert_equal 10, (child.salt_modules - parent.salt_modules).length end test 'second child inherits from parent' do parent = FactoryGirl.create :hostgroup, :with_salt_modules child_one = FactoryGirl.create :hostgroup, :parent => parent child_two = FactoryGirl.create :hostgroup, :parent => child_one assert_equal [], parent.salt_modules - child_two.salt_modules end end end
Version data entries
4 entries across 4 versions & 1 rubygems