Sha256: 8ebaf37f1c4be37c90a16a852567a6b422c16ed36355a1950e9180c9bcc78b62

Contents?: true

Size: 700 Bytes

Versions: 2

Compression:

Stored size: 700 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe "Chatterbot::Retweet" do
  describe "#retweet" do
    before(:each) do
      @bot = test_bot
    end

    it "calls require_login when tweeting" do
      @bot.should_receive(:require_login).and_return(false)
      @bot.retweet "tweet test!"
    end

    it "calls client.retweet with the right values" do
      bot = test_bot

      bot.should_receive(:require_login).and_return(true)
      bot.stub!(:client).and_return(mock(TwitterOAuth::Client))

      bot.stub!(:debug_mode?).and_return(false)

      tweet_id = 12345
      bot.client.should_receive(:retweet).with(tweet_id)
      bot.retweet(tweet_id)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chatterbot-0.5.1 spec/retweet_spec.rb
chatterbot-0.5.0 spec/retweet_spec.rb