Project

General

Profile

« Previous | Next » 

Revision c85a1c66

Added by Marek Hulán about 7 years ago

Fixes #18687 - restore hash format for parameter attributes

View differences:

test/controllers/api/v2/hosts_controller_test.rb
end
end
test "should update existing host parameters" do
test "should update existing host parameters using indexed hash format" do
host = FactoryGirl.create(:host, :with_parameter)
host_param = host.parameters.first
put :update, { :id => host.id, :host => { :host_parameters_attributes => { "0" => { :name => host_param.name, :value => "new_value" } } } }
assert_response :success
end
test "should update existing host parameters using array format" do
host = FactoryGirl.create(:host, :with_parameter)
host_param = host.parameters.first
put :update, { :id => host.id, :host => { :host_parameters_attributes => [{ :name => host_param.name, :value => "new_value" }] } }

Also available in: Unified diff