<commit_before>require 'test_helper'

module Tire

  class QueryStringIntegrationTest < Test::Unit::TestCase
    include Test::Integration

    context "Text query" do
      setup do
        ::RestClient.put "#{URL}/articles-test/article/plus-one", {:title => "+1 !!!"}.to_json
        ::RestClient.post "#{URL}/articles-test/_refresh", ''
      end

      should "find article by title" do
        results = Tire.search('articles-test') { query { text :title, '+1' } }.results

        assert_equal 1,        results.count
        assert_equal "+1 !!!", results.first[:title]
      end

    end

  end

end
<commit_msg>[TEST] Improved code in the Text Query integration test<commit_after>require 'test_helper'

module Tire

  class QueryStringIntegrationTest < Test::Unit::TestCase
    include Test::Integration

    context "Text query" do
      setup do
        Tire.index('articles-test') do
          store :type => 'article', :title => '+1 !!!'
          refresh
        end
      end

      should "find article by title" do
        results = Tire.search('articles-test') { query { text :title, '+1' } }.results

        assert_equal 1,        results.count
        assert_equal "+1 !!!", results.first[:title]
      end

    end

  end

end

{'fraction_non_alphanumeric': 0.12409927942353884, 'fraction_numerical': 0.006405124099279423, 'mean_word_length': 2.5410764872521248, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, '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': '652929', 'n_tokens_mistral': 384, 'n_tokens_neox': 359, 'n_words': 102}