You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: names_controller_test.rb
    path of file: ./repos/mushroom-observer/test/controllers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require("test_helper")

class NamesControllerTest < FunctionalTestCase
  include ObjectLinkHelper

  # EMAIL TESTS, currently in Names, Locations and their Descriptions
  # Has to be defined on class itself, include doesn't seem to work
  def self.report_email(email)
    @@emails ||= []
    @@emails << email
  end

  def setup
    @new_pts  = 10
    @chg_pts
    
  def test_index_with_descriptions
    login
    get(:index, params: { with_descriptions: true })

    assert_response(:success)
    assert_displayed_title("Names with Descriptions")
    assert_select("#results", { text: /not the default/ },
                  "Results should include non-default descriptions")
    assert_select(
      "#results a:match('href', ?)", %r{^#{names_path}/\d+},
      { count: Name.joins(:descriptions).
                    with_correct_spelling.
                    distinct.count },
      "Wrong number of (correctly spelled) Names"
    )
  end