Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module ForemanOpenscap
module ArfReportsControllerCommonExtensions
extend ActiveSupport::Concern
def format_filename
"#{@arf_report.asset.name}-#{@arf_report.reported_at.to_formatted_s(:number)}"
"#{@arf_report.host.name}-#{@arf_report.reported_at.to_formatted_s(:number)}"
end
end
end
5 changes: 5 additions & 0 deletions test/functional/arf_reports_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ class ArfReportsControllerTest < ActionController::TestCase
arf_report = FactoryBot.create(:arf_report, :host_id => @host.id)
report_html = File.read("#{ForemanOpenscap::Engine.root}/test/files/arf_report/arf_report.html")
ForemanOpenscap::ArfReport.any_instance.stubs(:to_html).returns(report_html)
refute arf_report.asset.nil?
get :download_html, :params => { :id => arf_report.id }, :session => set_session_user
assert_equal report_html, @response.body

arf_report.asset.destroy
get :download_html, :params => { :id => arf_report.id }, :session => set_session_user
assert_equal report_html, @response.body
end
Expand Down
Loading