<commit_before>require 'spec_helper'

describe Api::SearchController do

  describe '#show' do
    let(:term) { "rug" }

    context 'correctly receives an term parameter' do
      let(:helper) { double }

      it 'gets the specified quote' do
        expect(Line).to receive(:search).with(term).and_return(helper)
        expect(helper).to receive(:joins).with(:quote).and_return([])
        get :show, { term: term }
      end
    end

  end

end
<commit_msg>Fixed search controller spec<commit_after>require 'spec_helper'

describe Api::SearchController do

  describe '#show' do
    let(:term) { "rug" }

    context 'correctly receives an term parameter' do
      let(:helper) { double }

      it 'gets the specified quote' do
        expect(Line).to receive(:search).with(term).and_return(helper)
        expect(helper).to receive(:joins).with(:quote).and_return(helper)
        expect(helper).to receive(:includes).with(:character, :quote).and_return(helper)
        expect(helper).to receive(:map)
        get :show, { term: term }
      end
    end

  end

end

{'fraction_non_alphanumeric': 0.1259328358208955, 'fraction_numerical': 0.0, 'mean_word_length': 3.207843137254902, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5003784', 'n_tokens_mistral': 324, 'n_tokens_neox': 315, 'n_words': 82}