Sha256: d28278ae5e353ac6ba0cf9b4d0f6d39ef8f54b1312ce8bb573dc1cdb3ba91744

Contents?: true

Size: 1.03 KB

Versions: 3

Compression:

Stored size: 1.03 KB

Contents

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

describe Twitter::Client, "#account_info" do
  before(:each) do
    @uri = Twitter::Client.class_eval("@@ACCOUNT_URIS[:rate_limit_status]")
    @request = mas_net_http_get
    @twitter = client_context
    @default_header = @twitter.send(:http_header)
    @response = mas_net_http_response(:success)
    @connection = mas_net_http(@response)
    @response.stub!(:body).and_return("{}")
    Net::HTTP.stub!(:new).and_return(@connection)
    @rate_limit_status = mock(Twitter::RateLimitStatus)
    @twitter.stub!(:bless_models).and_return({})
  end

  it "should create expected HTTP GET request" do
    @twitter.should_receive(:rest_oauth_connect).with(:get, @uri).and_return(@response)
    @twitter.account_info
  end

  it "should raise Twitter::RESTError when 500 HTTP response received when giving page options" do
    @connection = mas_net_http(mas_net_http_response(:server_error))
    lambda {
      @twitter.account_info
    }.should raise_error(Twitter::RESTError)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twitter4r-0.5.2 spec/twitter/client/account_spec.rb
twitter4r-0.5.1 spec/twitter/client/account_spec.rb
twitter4r-0.5.0 spec/twitter/client/account_spec.rb