Revision df168113
Added by Amir Fefer over 7 years ago
test/functional/provisioning_templates_controller_test.rb | ||
---|---|---|
get :build_pxe_default, {}, set_session_user
|
||
assert_redirected_to provisioning_templates_path
|
||
end
|
||
|
||
test "pxe menu's labels should be sorted by full hostgroup title" do
|
||
first = FactoryGirl.build(:hostgroup, :with_parent, :name => "def", :operatingsystem => operatingsystems(:centos5_3), :architecture => architectures(:x86_64), :medium => media(:one))
|
||
second = FactoryGirl.build(:hostgroup, :with_parent, :name => "abc", :operatingsystem => operatingsystems(:centos5_3), :architecture => architectures(:x86_64), :medium => media(:one))
|
||
FactoryGirl.create(:template_combination, :provisioning_template => templates(:mystring2), :hostgroup => second)
|
||
FactoryGirl.create(:template_combination, :provisioning_template => templates(:mystring2), :hostgroup => first)
|
||
ProxyAPI::TFTP.any_instance.expects(:create_default).with(regexp_matches(/^PXE.*/), has_entry(:menu, regexp_matches(/#{first.name}.*#{second.name}/m))).returns(true).times(3)
|
||
get :build_pxe_default, {}, set_session_user
|
||
assert_redirected_to provisioning_templates_path
|
||
end
|
||
end
|
||
|
||
test 'preview' do
|
Also available in: Unified diff
Fixes #17151 - sort PXE labels by hostgroup title
(cherry picked from commit 741bf462072c31e88235114e753fa15131d30166)