Sha256: cc3427f6ffa506b5d23f94537a6fd6a08e70a9c3f92a4924618fd2a4e6467aa2

Contents?: true

Size: 1.34 KB

Versions: 9

Compression:

Stored size: 1.34 KB

Contents

require 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")
    @request = mas_net_http_get(:basic_auth => nil)
    @response = mas_net_http_response(:success)
    @connection = mas_net_http(@response)
    Net::HTTP.stub!(:new).and_return(@connection)
    @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(:create_http_get_request).with(@uris[:users]).and_return(@request)
    @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, @request, @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

9 entries across 9 versions & 2 rubygems

Version Path
cerberus-0.8.0 lib/vendor/twitter/spec/twitter/extras_spec.rb
cerberus-0.7.9 lib/vendor/twitter/spec/twitter/extras_spec.rb
edavis10-cerberus-0.7.8 lib/vendor/twitter/spec/twitter/extras_spec.rb
cerberus-0.7.8 lib/vendor/twitter/spec/twitter/extras_spec.rb
cerberus-0.7.7 lib/vendor/twitter/spec/twitter/extras_spec.rb
cerberus-0.7.6 lib/vendor/twitter/spec/twitter/extras_spec.rb
cerberus-0.7.2 lib/vendor/twitter/spec/twitter/extras_spec.rb
cerberus-0.7.5 lib/vendor/twitter/spec/twitter/extras_spec.rb
cerberus-0.7 lib/vendor/twitter/spec/twitter/extras_spec.rb