Project

General

Profile

« Previous | Next » 

Revision f3c1ecd3

Added by Ohad Levy about 13 years ago

  • ID f3c1ecd34b1b4f7284f69742ac4ac950dee627b9

fixes #847 - Retrieve last report information per host via the api

this adds two URLS to the API:

/hosts/fqdn/reports/last
/reports/last

both supports JSON output which provides all of the report information.

View differences:

test/functional/hosts_controller_test.rb
assert flash[:error] =~ /Failed to enable #{@host} for installation/
end
test "report should redirect to host's last report" do
get :report, {:id => @host.name}, set_session_user
assert_response :found
assert_redirected_to :controller => "reports", :action => "show", :id => Report.maximum(:id, :conditions => {:host_id => @host})
end
test "query in .yml format should return host.to_yml" do
User.current=nil
get :query, {:format => "yml"}

Also available in: Unified diff