Project

General

Profile

« Previous | Next » 

Revision be33e6e9

Added by Tomer Brisker over 8 years ago

Fixes #11650 - show global parameter value inherited from parent taxonomy

View differences:

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