Project

General

Profile

« Previous | Next » 

Revision 79c303c9

Added by Shira Maximov almost 6 years ago

Fixes #23373 - Fix host dissociation when updating host

View differences:

test/controllers/hosts_controller_test.rb
refute host.compute_resource_id
end
test "#host update shouldn't diassociate from VM" do
hostgroup = FactoryBot.create(:hostgroup, :with_environment, :with_subnet, :with_domain, :with_os, :with_compute_resource)
host = FactoryBot.create(:host, :hostgroup => hostgroup)
put :update, params: { :commit => "Update", :id => host.id, :params => {:compute_resource_id => ""}}, session: set_session_user
assert_response :redirect
host.reload
assert_not_nil host.compute_resource_id
end
test '#update_multiple_disassociate' do
host = FactoryBot.create(:host, :on_compute_resource)
post :update_multiple_disassociate, params: { :host_ids => [host.id], :host_names => [host.name] }, session: set_session_user

Also available in: Unified diff