Sha256: 584a7a58146f2820e4b58cae21cf7b596b36aaef4592d502468548b2c27e485d

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 KB

Contents

require 'helper'

describe Twitter::Action::Retweet do

  describe "#sources" do
    it "returns a collection of users who retweeted a user" do
      sources = Twitter::Action::Retweet.new(:sources => [{:id => 7505382}]).sources
      sources.should be_an Array
      sources.first.should be_a Twitter::User
    end
    it "is empty when not set" do
      sources = Twitter::Action::Retweet.new.sources
      sources.should be_empty
    end
  end

  describe "#target_objects" do
    it "returns a collection of retweets" do
      targets = Twitter::Action::Retweet.new(:target_objects => [{:id => 25938088801}]).target_objects
      targets.should be_an Array
      targets.first.should be_a Twitter::Tweet
    end
    it "is empty when not set" do
      targets = Twitter::Action::Retweet.new.target_objects
      targets.should be_empty
    end
  end

  describe "#targets" do
    it "returns a collection containing the retweeted user" do
      targets = Twitter::Action::Retweet.new(:targets => [{:id => 7505382}]).targets
      targets.should be_an Array
      targets.first.should be_a Twitter::User
    end
    it "is empty when not set" do
      targets = Twitter::Action::Retweet.new.targets
      targets.should be_empty
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
twitter-4.1.0 spec/twitter/action/retweet_spec.rb
twitter-4.0.0 spec/twitter/action/retweet_spec.rb