Skip to content

Instantly share code, notes, and snippets.

@GregSutcliffe
Created September 24, 2014 16:42
Show Gist options
  • Select an option

  • Save GregSutcliffe/f9fde7673004df58c9cf to your computer and use it in GitHub Desktop.

Select an option

Save GregSutcliffe/f9fde7673004df58c9cf to your computer and use it in GitHub Desktop.
test "should use a nested hostgroup parent root password" do
Setting[:root_pass] = "$1$default$hCkak1kaJPQILNmYbUXhD0"
h = FactoryGirl.create(:host, :managed, :with_hostgroup)
g = h.hostgroup
p = FactoryGirl.create(:hostgroup, :environment => h.environment)
p.update_attribute(:root_pass, "abc")
h.root_pass = nil
g.root_pass = nil
g.parent = p
g.save
assert h.save
assert h.root_pass.present?
assert_equal h.root_pass, p.root_pass
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment