From 9f79b346e736b1d04e4db16c8debff70aec3c232 Mon Sep 17 00:00:00 2001 From: laserlemon Date: Fri, 6 Nov 2009 00:52:00 +0800 Subject: [PATCH] Added a failing test for a Searchlogic::Search object not responding to question-marked methods correctly. --- spec/search_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/search_spec.rb b/spec/search_spec.rb index 44a2de6c..36032a75 100644 --- a/spec/search_spec.rb +++ b/spec/search_spec.rb @@ -342,4 +342,22 @@ User.search(:order => "ascend_by_username").proxy_options.should == User.ascend_by_username.proxy_options end end + + context "method delegation" do + it "should respond to count" do + User.create(:username => "bjohnson") + search1 = User.search(:username => "bjohnson") + search2 = User.search(:username => "nosnhojb") + search1.count.should == 1 + search2.count.should == 0 + end + + it "should respond to empty?" do + User.create(:username => "bjohnson") + search1 = User.search(:username => "bjohnson") + search2 = User.search(:username => "nosnhojb") + search1.empty?.should == false + search2.empty?.should == true + end + end end