Revision 915ee077
Added by Sebastian Gräßl over 7 years ago
test/integration/hostgroup_js_test.rb | ||
---|---|---|
assert_equal env.name, host.environment.name
|
||
end
|
||
|
||
describe 'edit form' do
|
||
setup do
|
||
@hostgroup = FactoryGirl.create(:hostgroup, :with_puppetclass)
|
||
@another_puppetclass = FactoryGirl.create(:puppetclass)
|
||
end
|
||
|
||
context 'puppet classes are not available in the environment' do
|
||
setup do
|
||
@hostgroup.puppetclasses << @another_puppetclass
|
||
visit edit_hostgroup_path(@hostgroup)
|
||
end
|
||
|
||
describe 'Puppet classes tab' do
|
||
test 'it shows a warning' do
|
||
click_link 'Puppet Classes'
|
||
wait_for_ajax
|
||
|
||
assert page.has_selector?('#puppetclasses_unavailable_warning')
|
||
end
|
||
|
||
test 'it marks selected classes as unavailable' do
|
||
click_link 'Puppet Classes'
|
||
wait_for_ajax
|
||
|
||
assert page.has_selector?('.selected_puppetclass.unavailable')
|
||
end
|
||
end
|
||
end
|
||
end
|
||
|
||
test 'submit updates taxonomy' do
|
||
group = FactoryGirl.create(:hostgroup, :with_puppetclass)
|
||
new_location = FactoryGirl.create(:location)
|
Also available in: Unified diff
Fixes #3551 - Show unavailable Puppet Classes in Host Group edit
Puppet Classes can be assigned to a Host Group even if they are
not available in the set environment.
The Classes persist through out changes of the environment,
but were previously hidden from the UI this changes that.
Unavailable Puppet Classes are now shown in the UI as greyed out
and a warning is displayed to inform the user about them.