Sha256: 7540010164fd2c44cddbc33466497d28b2cc083ea84a40dee8d08369e231fe2b

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

require File.expand_path('../../../helper', __FILE__)

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

3 entries across 3 versions & 1 rubygems

Version Path
octokit-0.5.2 spec/octokit/client/timelines_spec.rb
octokit-0.5.1 spec/octokit/client/timelines_spec.rb
octokit-0.5.0 spec/octokit/client/timelines_spec.rb