Project

General

Profile

« Previous | Next » 

Revision e8d6d2d6

Added by Shlomi Zadok over 8 years ago

fixes #4151 - enable reports STI

Permits subclassing of ReportImporter and Report to import and store
new types of reports associated to hosts.

View differences:

test/functional/api/v1/reports_controller_test.rb
end
test "should get last report" do
reports = FactoryGirl.create_list(:report, 5)
reports = FactoryGirl.create_list(:config_report, 5)
get :last
assert_response :success
assert_not_nil assigns(:report)
......
end
test "should get last report for given host only" do
main_report = FactoryGirl.create(:report)
main_report = FactoryGirl.create(:config_report)
FactoryGirl.create_list(:report, 5)
get :last, {:host_id => main_report.host.to_param }
assert_response :success
......
end
test 'cannot view the last report without hosts view permission' do
setup_user('view', 'reports')
setup_user('view', 'config_reports')
report = FactoryGirl.create(:report)
get :last, { :host_id => report.host.id }, set_session_user.merge(:user => User.current)
assert_response :not_found

Also available in: Unified diff