Revision 5b160515
Added by Tomer Brisker over 8 years ago
test/unit/parameter_test.rb | ||
---|---|---|
host.clear_host_parameters_cache!
|
||
assert_equal "pig", host.host_params["animal"]
|
||
end
|
||
|
||
test "parameters should display correct safe value for nested taxonomies" do
|
||
loc1 = FactoryGirl.create(:location)
|
||
loc2 = FactoryGirl.create(:location, :parent => loc1)
|
||
host = FactoryGirl.create(:host, :location => loc2)
|
||
|
||
loc1.location_parameters << LocationParameter.create(:name => "animal", :value => "lion")
|
||
params = host.host_inherited_params(true)
|
||
assert_equal "lion", params["animal"][:safe_value]
|
||
assert_equal loc1.title, params["animal"][:source_name]
|
||
|
||
loc2.location_parameters << LocationParameter.create(:name => "animal", :value => "dog")
|
||
params = host.host_inherited_params(true)
|
||
assert_equal "dog", params["animal"][:safe_value]
|
||
assert_equal loc2.title, params["animal"][:source_name]
|
||
end
|
||
end
|
Also available in: Unified diff
Fixes #11650 - show global parameter value inherited from parent taxonomy
(cherry picked from commit be33e6e905c8d0315262a3a3a45459c3a098a29e)