Sha256: 6fee18e55b4fb7ccd608ab5666dd4946d4365bd25b79e347969f1dd1b29de127

Contents?: true

Size: 1.05 KB

Versions: 19

Compression:

Stored size: 1.05 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(:basic_auth => nil)
    @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(:create_http_get_request).with(@uri).and_return(@request)
    @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

19 entries across 19 versions & 11 rubygems

Version Path
NewMonarch-twitter4r-0.3.2 spec/twitter/client/account_spec.rb
craigtmackenzie-twitter4r-0.3.1 spec/twitter/client/account_spec.rb
dambalah-twitter4r-0.3.3 spec/twitter/client/account_spec.rb
dferranti-twitter4r-0.4.0.1 spec/twitter/client/account_spec.rb
filipegiusti-twitter4r-0.3.2.1 spec/twitter/client/account_spec.rb
joshuamiller-twitter4r-0.3.1.2 spec/twitter/client/account_spec.rb
mbbx6spp-twitter4r-0.4.0 spec/twitter/client/account_spec.rb
theill-twitter4r-0.3.2 spec/twitter/client/account_spec.rb
cerberus-0.8.0 lib/vendor/twitter/spec/twitter/client/account_spec.rb
cerberus-0.7.9 lib/vendor/twitter/spec/twitter/client/account_spec.rb
edavis10-cerberus-0.7.8 lib/vendor/twitter/spec/twitter/client/account_spec.rb
cerberus-0.7.8 lib/vendor/twitter/spec/twitter/client/account_spec.rb
cerberus-0.7.7 lib/vendor/twitter/spec/twitter/client/account_spec.rb
cerberus-0.7.6 lib/vendor/twitter/spec/twitter/client/account_spec.rb
cerberus-0.7.2 lib/vendor/twitter/spec/twitter/client/account_spec.rb
cerberus-0.7.5 lib/vendor/twitter/spec/twitter/client/account_spec.rb
twitter4r-0.3.2 spec/twitter/client/account_spec.rb
cerberus-0.7 lib/vendor/twitter/spec/twitter/client/account_spec.rb
twitter4r-0.3.1 spec/twitter/client/account_spec.rb