module ThoughtBot::Shoulda::Controller::HTML::ClassMethods

def make_index_html_tests(res)

def make_index_html_tests(res)
  context "on GET to #{controller_name_from_class}#index" do
    setup do
      record = get_existing_record(res) rescue nil
      parent_params = make_parent_params(res, record)
      get(:index, parent_params)          
    end
    if res.denied.actions.include?(:index)
      should_not_assign_to res.object.to_s.pluralize
      should_redirect_to res.denied.redirect
      should_set_the_flash_to res.denied.flash          
    else
      should_respond_with :success
      should_assign_to res.object.to_s.pluralize
      should_render_template :index
      should_not_set_the_flash
    end
  end
end