From: Nick Lewis <[email protected]> Removed: /nodes/<node_name>/reports.{json,yaml} /nodes/<node_name> (json format)
These formats were just using the default YAML/JSON representations of the ActiveRecord classes. Therefore, they are extremely unlikely to have been used by any users, and were just adding maintenance expense. In the future, we plan to reintroduce these features in a useful form, per ticket #4643. Paired-With: Paul Berry Signed-off-by: Matt Robinson <[email protected]> --- Local-branch: ticket/next/5543 app/controllers/nodes_controller.rb | 3 - spec/controllers/nodes_controller_spec.rb | 65 ----------------------------- 2 files changed, 0 insertions(+), 68 deletions(-) diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index 4c3a8d8..fff6e27 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb @@ -96,8 +96,6 @@ class NodesController < InheritedResources::Base @reports = @node.reports respond_to do |format| format.html { @reports = paginate_scope(@reports); render 'reports/index' } - format.yaml { render :text => @reports.to_yaml, :content_type => 'application/x-yaml' } - format.json { render :json => @reports.to_json } end end @@ -130,7 +128,6 @@ class NodesController < InheritedResources::Base format.html { render :index } format.yaml { render :text => collection.to_yaml, :content_type => 'application/x-yaml' } - format.json { render :json => collection.to_json } end end end diff --git a/spec/controllers/nodes_controller_spec.rb b/spec/controllers/nodes_controller_spec.rb index 9e7f60b..2c9bb7e 100644 --- a/spec/controllers/nodes_controller_spec.rb +++ b/spec/controllers/nodes_controller_spec.rb @@ -376,51 +376,6 @@ describe NodesController do assigns[:reports].should be_a_kind_of(WillPaginate::Collection) end end - - context "for YAML" do - before { get :reports, :node => 123, :format => "yaml" } - - specify { response.should be_success } - - it "should not be paginated" do - assigns[:reports].should_not be_a_kind_of(WillPaginate::Collection) - end - - it "should return YAML" do - response.body.should =~ %r{ruby/object:Report} - struct = yaml_from_response_body - struct.size.should == 1 - struct.first.should == @report - end - end - - context "for JSON" do - before { get :reports, :node => 123, :format => "json" } - - specify { response.should be_success } - - it "should not be paginated" do - assigns[:reports].should_not be_a_kind_of(WillPaginate::Collection) - end - - it "should return JSON" do - struct = json_from_response_body - struct.size.should == 1 - - for key in %w[host id node_id status] - struct.first[key].should == @report.send(key) - end - - struct.first['report']['metrics']['resources']['values'].tap do |values| - @report.total_resources.should == values.find{|t| t.first['total']}[2] - @report.failed_resources.should == values.find{|t| t.first['failed']}[2] - end - - struct.first['report']['metrics']['time']['values'].tap do |values| - @report.total_time.should == (Report::TOTAL_TIME_FORMAT % values.find{|t| t.first['total']}[2].to_s) - end - end - end end # Relies on #action returning name of a NodesController action, e.g. as "successful". @@ -466,26 +421,6 @@ describe NodesController do end end end - - context "as JSON" do - before { get action, action_params.merge(:format => "json") } - - specify { response.should be_success } - - it "should assign only appropriate records" do - assigns[:nodes].size.should == 1 - end - - it "should not be paginated" do - assigns[:nodes].should_not be_a_kind_of(WillPaginate::Collection) - end - - it "should return JSON" do - struct = json_from_response_body - struct.size.should == 1 - struct.first["name"].should == "foo" - end - end end describe "#successful" do -- 1.7.3.1 -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.
