-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
timelines_spec.rb
42 lines (31 loc) · 1.11 KB
/
timelines_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# -*- 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