<commit_before>require 'test_helper'

class SearchControllerTest < ActionController::TestCase

  test 'GET search which raises VacancySearch::LocationMissing' do
    VacancySearch.expects(:new).raises(VacancySearch::LocationMissing)
    get :show
    assert_redirected_to root_path
  end

  test 'GET search which raises a VacancySearch::SearchError' do
    VacancySearch.expects(:new).raises(VacancySearch::SearchError)
    get :show
    assert_response 500
  end

  test 'GET search which is a success' do
    mock_results = mock()
    mock_results.stubs(:total => 0)

    mock_search = mock()
    mock_search.stubs(:run => mock_results, :query_params => {}, :location => "postcode", :query => "machine")

    VacancySearch.expects(:new).returns(mock_search)

    get :show
    assert_response :success
  end

end<commit_msg>another blind attempted test fix<commit_after>require 'test_helper'

class SearchControllerTest < ActionController::TestCase

  test 'GET search which raises VacancySearch::LocationMissing' do
    VacancySearch.expects(:new).raises(VacancySearch::LocationMissing)
    get :show
    assert_redirected_to root_path
  end

  test 'GET search which raises a VacancySearch::SearchError' do
    VacancySearch.expects(:new).raises(VacancySearch::SearchError)
    get :show
    assert_response 500
  end

  test 'GET search which is a success' do
    mock_results = mock()
    mock_results.stubs(:total => 0)

    mock_search = mock()
    mock_search.stubs(:run => mock_results, :query_params => {}, :location => "postcode", :query => "machine")
    mock_search.stubs(:docs)

    VacancySearch.expects(:new).returns(mock_search)

    get :show
    assert_response :success
  end

end

{'fraction_non_alphanumeric': 0.09982384028185555, 'fraction_numerical': 0.004697592483852026, 'mean_word_length': 4.532467532467533, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1874763', 'n_tokens_mistral': 538, 'n_tokens_neox': 512, 'n_words': 124}