spec/search_spec.rb in chatterbot-0.3.0 vs spec/search_spec.rb in chatterbot-0.4.0

- old
+ new

@@ -76,10 +76,19 @@ bot.stub!(:client).and_return(fake_search(100)) bot.client.should_receive(:search).with("foo -include:retweets", {:since_id => 123, :result_type => "recent"}) bot.search("foo") end + + it "updates since_id when complete" do + bot = test_bot + results = fake_search(100, 1, 1000) + + bot.stub!(:client).and_return(results) + + bot.search("foo") + end it "iterates results" do bot = test_bot bot.stub!(:client).and_return(fake_search(100, 3)) indexes = [] @@ -91,10 +100,9 @@ indexes.should == [1,2,3] end it "checks blacklist" do bot = test_bot -# bot = Chatterbot::Bot.new bot.stub!(:client).and_return(fake_search(100, 3)) bot.stub!(:on_blacklist?).and_return(true, false) indexes = []