spec/reply_spec.rb in chatterbot-0.2.2 vs spec/reply_spec.rb in chatterbot-0.2.3
- old
+ new
@@ -16,11 +16,10 @@
# bot.replies
# end
it "iterates results" do
- #bot = Chatterbot::Bot.new
bot = test_bot
bot.should_receive(:require_login).and_return(true)
bot.stub!(:client).and_return(fake_replies(100, 3))
bot.should_receive(:update_since_id).exactly(3).times
@@ -33,11 +32,10 @@
indexes.should == [1,2,3]
end
it "checks blacklist" do
bot = test_bot
-# bot = Chatterbot::Bot.new
bot.should_receive(:require_login).and_return(true)
bot.stub!(:client).and_return(fake_replies(100, 3))
bot.should_receive(:update_since_id).exactly(2).times
@@ -49,6 +47,31 @@
end
indexes.should == [2,3]
end
+
+ it "passes along since_id" do
+ bot = test_bot
+ bot.should_receive(:require_login).and_return(true)
+ bot.stub!(:client).and_return(fake_replies(100, 3))
+ bot.stub!(:since_id).and_return(123)
+
+ bot.client.should_receive(:replies).with({:since_id => 123})
+
+ bot.replies
+ end
+
+
+ it "doesn't pass along invalid since_id" do
+ bot = test_bot
+ bot.should_receive(:require_login).and_return(true)
+ bot.stub!(:client).and_return(fake_replies(100, 3))
+ bot.stub!(:since_id).and_return(0)
+
+ bot.client.should_receive(:replies).with({ })
+
+ bot.replies
+ end
+
+
end