module ThoughtBot::Shoulda::Controller::XML::ClassMethods

def make_index_xml_tests(res) # :nodoc:

:nodoc:
def make_index_xml_tests(res) # :nodoc:
  context "on GET to #{controller_name_from_class}#index as xml" do
    setup do
      request_xml
      parent_params = make_parent_params(res)
      get(:index, parent_params)          
    end
    if res.denied.actions.include?(:index)
      should_not_assign_to res.object.to_s.pluralize
      should_respond_with 401          
    else
      should_respond_with :success
      should_respond_with_xml_for res.object.to_s.pluralize
      should_assign_to res.object.to_s.pluralize
    end
  end
end