Sha256: ea800b4420858096ce44b08499500a840164ee96aa7b9965a13f866a49c9c0f0

Contents?: true

Size: 1.27 KB

Versions: 3

Compression:

Stored size: 1.27 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))

describe Twitter::Client, "#featured(:users)" do
  before(:each) do
    @twitter = client_context
    @uris = Twitter::Client.class_eval("@@FEATURED_URIS")
    @response = mas_net_http_response(:success)
    @connection = mas_net_http(@response)
    @users = [
      Twitter::User.new(:screen_name => 'twitter4r'),
      Twitter::User.new(:screen_name => 'dictionary'),      
    ]
    Twitter::User.stub!(:unmarshal).and_return(@users)
  end
  
  it "should create expected HTTP GET request" do
    @twitter.should_receive(:rest_oauth_connect).with(:get, @uris[:users]).and_return(@response)
    @twitter.featured(:users)
  end
  
  it "should bless Twitter::User models returned" do
    @twitter.should_receive(:bless_models).with(@users).and_return(@users)
    @twitter.featured(:users)
  end
  
  after(:each) do
    nilize(@twitter, @uris, @response, @connection)
  end
end

describe Twitter::User, ".featured" do
  before(:each) do
    @twitter = client_context
  end
  
  it "should delegate #featured(:users) message to given client context" do
    @twitter.should_receive(:featured).with(:users).and_return([])
    Twitter::User.featured(@twitter)
  end
  
  after(:each) do
    nilize(@twitter)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twitter4r-0.7.0 spec/twitter/extras_spec.rb
twitter4r-0.6.0 spec/twitter/extras_spec.rb
twitter4r-0.5.3 spec/twitter/extras_spec.rb