Sha256: 6de55f39b2306730c0f4832434e97d1b31d5238fb165890ad89071044c458f98

Contents?: true

Size: 1.09 KB

Versions: 2

Compression:

Stored size: 1.09 KB

Contents

require 'helper'

describe Octokit::Client::Users do

  describe ".timeline" do

    it "should return the public timeline" do
      client = Octokit::Client.new
      stub_get("https://github.com/timeline.json").
        to_return(:body => fixture("timeline.json"))
      events = client.timeline
      events.first.repository.name.should == "homebrew"
    end

  end

  describe ".user_timeline" do

    it "should return a user timeline" do
      client = Octokit::Client.new
      stub_get("https://github.com/sferik.json").
        to_return(:body => fixture("timeline.json"))
      events = client.user_timeline("sferik")
      events.first.repository.name.should == "homebrew"
    end
    
    context "when authenticated" do

      it "should return a user timeline" do
        client = Octokit::Client.new(:login => "sferik", :token => "OU812")
        stub_get("https://github.com/sferik.private.json?token=OU812").
          to_return(:body => fixture("timeline.json"))
        events = client.user_timeline("sferik")
        events.first.repository.name.should == "homebrew"
      end

    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
octokit-0.6.1 spec/octokit/client/timelines_spec.rb
octokit-0.6.0 spec/octokit/client/timelines_spec.rb