Sha256: d8b02af85596ada6b4e4fa6a6fa255abdf6309badff19141832a8ab1d162fadc

Contents?: true

Size: 1.21 KB

Versions: 2

Compression:

Stored size: 1.21 KB

Contents

require 'helper'

describe Githu3::User do

  def sbellity
    stub_get "/users/sbellity", "users/sbellity"
    @client.user("sbellity")
  end

  before do
    @client = Githu3::Client.new("myvalidtoken")
  end
  
  describe "Getting a users's stuff..." do
    
    it "should get a user's infos" do
      sbellity.login.should == "sbellity"
    end
    
    it "should get the user's public repos" do
      stub_get "/users/sbellity/repos", "users/repos"
      sbellity.repos.length.should == 5
    end
    
    it "should get the user's member repos" do
      stub_get "/users/sbellity/repos?type=member", "users/repos"
      sbellity.repos(:type => 'member').length.should == 5
    end
    
    it "should get the user's public orgs" do
      stub_get "/users/sbellity/orgs", "users/orgs"
      sbellity.orgs.length.should == 1
      sbellity.orgs.first.login.should == "sixdegrees"
    end
    
    it "should get the user's followers" do
      stub_get "/users/sbellity/followers", "users/followers"
      sbellity.followers.length.should == 13
    end
    
    it "should get the user's following" do
      stub_get "/users/sbellity/following", "users/following"
      sbellity.following.length.should == 30
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
githu3-0.0.3 spec/githu3/user_spec.rb
githu3-0.0.2 spec/githu3/user_spec.rb