Project

General

Profile

« Previous | Next » 

Revision 42e9040a

Added by Michael Moll over 7 years ago

Fixes #18581 - conditionalize SUSE mediapath

View differences:

lib/foreman/renderer.rb
def yast_attributes
@dynamic = @host.diskLayout =~ /^#Dynamic/ if (@host.respond_to?(:disk) && @host.disk.present?) || @host.ptable.present?
@mediapath = @host.operatingsystem.mediumpath @host
@mediapath = @host.operatingsystem.mediumpath @host if @host.medium
end
def coreos_attributes
test/unit/foreman/renderer_test.rb
end
end
describe "yast_attributes" do
test "does not fail if @host does not have medium" do
@renderer.host = FactoryGirl.build(:host)
@renderer.send :yast_attributes
assert_nil @renderer.instance_variable_get('@mediapath')
end
end
test '#foreman_url can be rendered even outside of controller context' do
assert_nothing_raised do
assert_match /\/unattended\/built/, @renderer.foreman_url('built')

Also available in: Unified diff