Sha256: f7df7922dcb8a9781c33fa4b555c83f9688cabfbaf26edaaccecb4b13483dbf2
Contents?: true
Size: 1.36 KB
Versions: 1
Compression:
Stored size: 1.36 KB
Contents
# encoding: UTF-8 require 'acceptance/spec_helper' describe 'Searching within a model', :live => true do it "returns results" do article = Article.create! :title => 'Pancakes' index Article.search.first.should == article end it "returns results matching the given query" do pancakes = Article.create! :title => 'Pancakes' waffles = Article.create! :title => 'Waffles' index articles = Article.search 'pancakes' articles.should include(pancakes) articles.should_not include(waffles) end it "handles unicode characters" do istanbul = City.create! :name => 'İstanbul' index City.search('İstanbul').to_a.should == [istanbul] end it "will star provided queries on request" do article = Article.create! :title => 'Pancakes' index Article.search('cake', :star => true).first.should == article end it "allows for searching on specific indices" do article = Article.create :title => 'Pancakes' index articles = Article.search('pancake', :indices => ['stemmed_article_core']) articles.to_a.should == [article] end end describe 'Searching within a model with a realtime index', :live => true do it "returns results" do pending "Sphinx bug on OS X means I can't currently test this." product = Product.create! :name => 'Widget' Product.search.first.should == product end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
thinking-sphinx-3.0.0.pre | spec/acceptance/searching_within_a_model_spec.rb |