Sha256: 8a40c0692dfd10fdc52bdc21410ff7a85d8f3dc66846012e7394ed5a0edc0adc

Contents?: true

Size: 1009 Bytes

Versions: 14

Compression:

Stored size: 1009 Bytes

Contents

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

describe "Chatterbot::Followers" do
  before(:each) do
    @bot = test_bot
  end

  describe "followers" do
    it "calls require_login" do
      expect(@bot).to receive(:require_login).and_return(false)
      @bot.followers
    end

    it "returns followers" do
      expect(@bot).to receive(:require_login).and_return(true)
      allow(@bot).to receive(:client).and_return(fake_followers(3))

      result = @bot.followers
      expect(result.size).to eq(3)
      expect(result[0].name).to eq("Follower 1")
    end
  end

  describe "follow" do
    it "calls require_login" do
      expect(@bot).to receive(:require_login).and_return(false)
      @bot.follow(1234)
    end

    it "works" do
      expect(@bot).to receive(:require_login).and_return(true)
      allow(@bot).to receive(:client).and_return(double(Twitter::Client))
      expect(@bot.client).to receive(:follow).with(1234)
      
      @bot.follow(1234)
    end
  end

  
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
chatterbot-2.2.0 spec/followers_spec.rb
chatterbot-2.1.0 spec/followers_spec.rb
chatterbot-2.0.5 spec/followers_spec.rb
chatterbot-2.0.4 spec/followers_spec.rb
chatterbot-2.0.3 spec/followers_spec.rb
chatterbot-2.0.2 spec/followers_spec.rb
chatterbot-1.0.2 spec/followers_spec.rb
chatterbot-2.0.0.pre spec/followers_spec.rb
chatterbot-1.0.1 spec/followers_spec.rb
chatterbot-1.0.0 spec/followers_spec.rb
chatterbot-0.9.3 spec/followers_spec.rb
chatterbot-0.9.2 spec/followers_spec.rb
chatterbot-0.9.1 spec/followers_spec.rb
chatterbot-0.9.0 spec/followers_spec.rb