Project

General

Profile

« Previous | Next » 

Revision 915ee077

Added by Sebastian Gräßl over 7 years ago

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.

View differences:

test/integration/hostgroup_test.rb
assert page.has_link? 'staging'
end
test "edit page" do
visit hostgroups_path
click_link "db"
fill_in "hostgroup_name", :with => "db Old"
assert_submit_button(hostgroups_path)
assert page.has_link? 'db Old'
describe 'edit page' do
setup do
@another_environment = FactoryGirl.create(:environment)
@hostgroup = FactoryGirl.create(:hostgroup, :with_puppetclass)
visit hostgroups_path
click_link @hostgroup.name
end
test 'changing hostgroup_name' do
new_hostgroup_name = "#{@hostgroup.name} Old"
fill_in 'hostgroup_name', with: new_hostgroup_name
assert_submit_button(hostgroups_path)
assert page.has_link? new_hostgroup_name
end
describe 'changing the environment' do
test 'preserves the puppetclasses' do
puppetclasses = @hostgroup.puppetclasses.all
select @another_environment.name, from: 'hostgroup_environment_id'
assert_submit_button(hostgroups_path)
assert_equal puppetclasses, @hostgroup.puppetclasses.all
end
end
end
test 'edit shows errors on invalid lookup values' do

Also available in: Unified diff