Skip to content

Instantly share code, notes, and snippets.

@iHiD
Created October 23, 2013 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iHiD/7120785 to your computer and use it in GitHub Desktop.
Save iHiD/7120785 to your computer and use it in GitHub Desktop.
Inquisitio
def self.search(name)
User.where(id: Inquisition.search(name, type: "User").ids)
end
describe "User searching" do
it "should return users" do
user = create(:user)
Inquisitio::Searcher.any_instance.stubs(:search)
Inquisitio::Searcher.any_instance.stubs(ids: [user.id])
users = User.search(user.name)
users.should == [user]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment