Skip to content

Commit

Permalink
Fix hostgroup tests (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Apr 26, 2019
1 parent f638837 commit e8f7009
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions test/unit/hostgroup_extensions_test.rb
Expand Up @@ -21,20 +21,26 @@ class HostgroupExtensionsTest < ActiveSupport::TestCase

test 'child host group inherits salt proxy from child parent' do
parent = FactoryBot.create :hostgroup
child_one = FactoryBot.create :hostgroup, :parent => parent
child_one.salt_proxy = @proxy
child_one.reload
child_one = FactoryBot.create :hostgroup, :parent => parent, :salt_proxy => @proxy
child_two = FactoryBot.create :hostgroup, :parent => child_one
assert_not_nil parent
assert_not_nil child_one
assert_not_nil child_two
assert_not_nil child_one.salt_proxy
assert_not_nil child_two.salt_proxy
assert_equal child_two.salt_proxy, child_one.salt_proxy
end

test 'child host group inherits salt environment from child parent' do
environment = FactoryBot.create :salt_environment
parent = FactoryBot.create :hostgroup
child_one = FactoryBot.create :hostgroup, :parent => parent
child_one.salt_environment = environment
child_one.reload
child_one = FactoryBot.create :hostgroup, :parent => parent, :salt_environment => environment
child_two = FactoryBot.create :hostgroup, :parent => child_one
assert_not_nil parent
assert_not_nil child_one
assert_not_nil child_two
assert_not_nil child_one.salt_environment
assert_not_nil child_two.salt_environment
assert_equal child_two.salt_environment, child_one.salt_environment
end

Expand Down

0 comments on commit e8f7009

Please sign in to comment.