Revision f391021c
Added by Ori Rabin about 8 years ago
test/integration/host_js_test.rb | ||
---|---|---|
assert_equal domain.subnets.first.id.to_s, subnet_id
|
||
assert_equal domain.subnets.first.to_label, subnet_label
|
||
end
|
||
|
||
test "selecting domain updates puppetclass parameters" do
|
||
disable_orchestration
|
||
domain = FactoryGirl.create(:domain)
|
||
|
||
host = FactoryGirl.create(:host, :with_puppetclass)
|
||
|
||
lookup_key = FactoryGirl.create(:puppetclass_lookup_key, :as_smart_class_param, :with_override, :path => 'domain',
|
||
:puppetclass => host.puppetclasses.first, :default_value => 'default')
|
||
LookupValue.create(:value => 'domain', :match => "domain=#{domain.name}", :lookup_key_id => lookup_key.id)
|
||
|
||
visit edit_host_path(host)
|
||
assert page.has_link?('Parameters', :href => '#params')
|
||
click_link 'Parameters'
|
||
assert_equal class_params.find("textarea").value, "default"
|
||
|
||
click_link 'Interfaces'
|
||
table.first(:button, 'Edit').click
|
||
|
||
select2 domain.name, :from => 'host_interfaces_attributes_0_domain_id'
|
||
wait_for_ajax
|
||
modal.find(:button, "Ok").click
|
||
|
||
assert page.has_link?('Parameters', :href => '#params')
|
||
click_link 'Parameters'
|
||
assert_equal "domain", class_params.find("textarea").value
|
||
end
|
||
end
|
||
|
||
describe "switching flags from the overview table" do
|
Also available in: Unified diff
Fixes #14790 - reloads puppetclass parameters when choosing os and domain