Sha256: 738d197730be93eb7c7d41e7df9851cd67c02aad84d71eef83d82101ec2443d0

Contents?: true

Size: 1.11 KB

Versions: 15

Compression:

Stored size: 1.11 KB

Contents

# -*- encoding: utf-8 -*-
require 'helper'

describe Octokit::Client::Timelines 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", :password => "sekret")
        stub_get("https://github.com/sferik.private.json").
          to_return(:body => fixture("timeline.json"))
        events = client.user_timeline("sferik")
        events.first.repository.name.should == "homebrew"
      end

    end

  end

end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
octokit-1.4.0 spec/octokit/client/timelines_spec.rb
octokit-1.3.0 spec/octokit/client/timelines_spec.rb
octokit-1.2.1 spec/octokit/client/timelines_spec.rb
octokit-1.2.0 spec/octokit/client/timelines_spec.rb
octokit-1.1.1 spec/octokit/client/timelines_spec.rb
octokit-1.1.0 spec/octokit/client/timelines_spec.rb
octokit-1.0.7 spec/octokit/client/timelines_spec.rb
octokit-1.0.6 spec/octokit/client/timelines_spec.rb
octokit-1.0.5 spec/octokit/client/timelines_spec.rb
octokit-1.0.4 spec/octokit/client/timelines_spec.rb
octokit-1.0.3 spec/octokit/client/timelines_spec.rb
octokit-1.0.2 spec/octokit/client/timelines_spec.rb
octokit-1.0.1 spec/octokit/client/timelines_spec.rb
octokit-1.0.0 spec/octokit/client/timelines_spec.rb
octokit-0.6.5 spec/octokit/client/timelines_spec.rb