Sha256: 3acb8b7c61e1fae82a1039c78114157b282bc53cdfbb928954675856544c57db
Contents?: true
Size: 1.46 KB
Versions: 3
Compression:
Stored size: 1.46 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 it "can search on namespaced models" do person = Admin::Person.create :name => 'James Bond' index Admin::Person.search('Bond').to_a.should == [person] end end describe 'Searching within a model with a realtime index', :live => true do it "returns results" do product = Product.create! :name => 'Widget' Product.search.first.should == product end end
Version data entries
3 entries across 3 versions & 1 rubygems