Project

General

Profile

« Previous | Next » 

Revision 8c68024a

Added by Daniel Lobato Garcia over 10 years ago

fixes #2231 - hostgroup deletion is restricted to hostgroups without children

View differences:

test/functional/api/v2/hostgroups_controller_test.rb
assert_response :success
end
test "blocks API deletion of hosts with children" do
assert hostgroups(:parent).has_children?
assert_no_difference('Hostgroup.count') do
delete :destroy, { :id => hostgroups(:parent).to_param }
end
assert_response :conflict
end
test "should create nested hostgroup with a parent" do
assert_difference('Hostgroup.count') do
post :create, { :hostgroup => valid_attrs.merge(:parent_id => hostgroups(:common).id) }

Also available in: Unified diff