Sha256: 98446a8072c6f0bd806b0eaa37aec896d2c2286918b04567af1a8552712553c1

Contents?: true

Size: 998 Bytes

Versions: 2

Compression:

Stored size: 998 Bytes

Contents

require 'spec_helper'

describe SocialProfile::People::Twitter do
  it "should be a Module" do
    SocialProfile::People.should be_a(Module)
  end

  context "twitter" do
    before(:each) do
      @user = SocialProfile::Person.get(:twitter, "123456", "abc", :api_key => "111", :api_secret => "222", :token_secret => "333")
      stub_request(:post, "https://api.twitter.com/oauth2/token").with(:body => {'grant_type' => 'client_credentials'}).
        to_return(:body => fixture("twitter/token.json"), :headers => {:content_type => 'application/json; charset=utf-8'})
      stub_request(:get, "https://api.twitter.com/1.1/account/verify_credentials.json").
        to_return(:body => fixture('twitter/auth.json'), :headers => {:content_type => 'application/json; charset=utf-8'})
    end

    it "should be a twitter profile" do
      @user.should be_a(SocialProfile::People::Twitter)
    end

    it "should response to friends_count" do
      @user.friends_count.should == 4051
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
social_profile-0.2.1 spec/people/twitter_spec.rb
social_profile-0.2.0 spec/people/twitter_spec.rb