Revision 2fba6ad7
Added by Ondřej Pražák over 8 years ago
test/functional/hosts_controller_test.rb | ||
---|---|---|
assert_template :partial => '_form'
|
||
end
|
||
|
||
def test_submit_multiple_rebuild_config_optimistic
|
||
@request.env['HTTP_REFERER'] = hosts_path
|
||
Host.any_instance.expects(:recreate_config).returns({"TFTP" => true, "DHCP" => true, "DNS" => true})
|
||
h = FactoryGirl.create(:host)
|
||
post :submit_rebuild_config, {:host_ids => [h.id]}, set_session_user
|
||
|
||
assert_response :found
|
||
assert_redirected_to hosts_path
|
||
assert_not_nil flash[:notice]
|
||
end
|
||
|
||
def test_submit_multiple_rebuild_config_pessimistic
|
||
@request.env['HTTP_REFERER'] = hosts_path
|
||
Host.any_instance.expects(:recreate_config).returns({"TFTP" => false, "DHCP" => false, "DNS" => false})
|
||
h = FactoryGirl.create(:host)
|
||
post :submit_rebuild_config, {:host_ids => [h.id]}, set_session_user
|
||
|
||
assert_response :found
|
||
assert_redirected_to hosts_path
|
||
assert_not_nil flash[:error]
|
||
end
|
||
|
||
private
|
||
|
||
def initialize_host
|
Also available in: Unified diff
Fixes #2267 - general rebuild of TFTP, DNS, DHCP