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: changesets_controller_test.rb
    path of file: ./repos/openstreetmap-website/test/controllers
    
    the code of the file until where you have to start completion: require "test_helper"

c
    
  def test_index_nearby
    private_user = create(:user, :data_public => false, :home_lat => 51.1, :home_lon => 1.0)
    user = create(:user, :home_lat => 51.0, :home_lon => 1.0)
    far_away_user = create(:user, :home_lat => 51.0, :home_lon => 130)
    changeset = create(:changeset, :user => user, :num_changes => 1)
    _changeset2 = create(:changeset, :user => far_away_user, :num_changes => 1)

    get nearby_changesets_path
    assert_redirected_to login_path(:referer => nearby_changesets_path)

    session_for(private_user)

    get nearby_changesets_path
    assert_response :success
    assert_template "history"

    get nearby_changesets_path(:list => "1"), :xhr => true
    assert_response :success
    assert_template "index"

    check_index_result([changeset])
  end