Skip to content

Instantly share code, notes, and snippets.

@mmmurf
Created November 20, 2008 23:13
Show Gist options
  • Save mmmurf/27263 to your computer and use it in GitHub Desktop.
Save mmmurf/27263 to your computer and use it in GitHub Desktop.
require 'spec/spec_helper'
describe "ThinkingSphinx::ActiveRecord (testing total entries results) " do
before :all do
@sphinx.setup_sphinx
@sphinx.start
end
after :all do
@sphinx.stop
end
it "should have Buckleys" do
Person.search("Buckley").total_entries.should == 3
end
it "should have n ids" do
Person.search(:with => {:ids => [1,2,3]}).total_entries.should == 3
end
it "should contain be 245 people born in the sixties" do
nineteen_sixties = Time.utc(1960,"jan",1)..Time.utc(1970, "jan", 1)
Person.search(:with => {:birthday => nineteen_sixties}).total_entries.should == 245
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment