Revision 9d43fc71
Added by Michael Moll almost 6 years ago
test/models/puppetclass_test.rb | ||
---|---|---|
@one.save!
|
||
end
|
||
as_user :one do
|
||
nested_lookup_key_params = {:new_1372154591368 => {:key=>"test_param", :key_type=>"string", :default_value => "7777", :path =>"fqdn\r\nhostgroup\r\nos\r\ndomain"}}
|
||
nested_lookup_key_params = {:new_1372154591368 => {:key => "test_param", :key_type => "string", :default_value => "7777", :path => "fqdn\r\nhostgroup\r\nos\r\ndomain"}}
|
||
assert Puppetclass.first.update(:lookup_keys_attributes => nested_lookup_key_params)
|
||
end
|
||
end
|
||
... | ... | |
klass = FactoryBot.create(:puppetclass)
|
||
hostgroup = FactoryBot.create(:hostgroup)
|
||
lk = FactoryBot.create(:variable_lookup_key, puppetclass_id: klass.id)
|
||
attributes = {"hostgroup_ids"=>[hostgroup.id],
|
||
"lookup_keys_attributes"=>
|
||
{"0"=>
|
||
{ "_destroy"=>"false",
|
||
"key"=>"hahs",
|
||
"description"=>"",
|
||
"key_type"=>"hash",
|
||
"default_value"=>"{\"foo\" => \"bar\"}",
|
||
"hidden_value"=>"0",
|
||
"validator_type"=>"",
|
||
"path"=>"owner\r\nfqdn\r\nhostgroup\r\nos\r\ndomain",
|
||
"merge_overrides"=>"0",
|
||
"lookup_values_attributes"=>{"0"=>{"match"=>"owner=sdgsd", "value"=>"{\"foo\" => \"bar\"}", "_destroy"=>"false"}},
|
||
"id"=>lk.id
|
||
attributes = {"hostgroup_ids" => [hostgroup.id],
|
||
"lookup_keys_attributes" =>
|
||
{"0" =>
|
||
{ "_destroy" => "false",
|
||
"key" => "hahs",
|
||
"description" => "",
|
||
"key_type" => "hash",
|
||
"default_value" => "{\"foo\" => \"bar\"}",
|
||
"hidden_value" => "0",
|
||
"validator_type" => "",
|
||
"path" => "owner\r\nfqdn\r\nhostgroup\r\nos\r\ndomain",
|
||
"merge_overrides" => "0",
|
||
"lookup_values_attributes" => {"0" => {"match" => "owner=sdgsd", "value" => "{\"foo\" => \"bar\"}", "_destroy" => "false"}},
|
||
"id" => lk.id
|
||
}
|
||
}
|
||
}
|
Also available in: Unified diff
Fixes #19789 - fix Layout/SpaceAroundOperators cop