Skip to content

Commit fb1d1d1

Browse files
committed
Add integration specs for stack overflow bug.
1 parent 999bbe0 commit fb1d1d1

1 file changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# encoding: utf-8
2+
3+
require 'spec_helper'
4+
5+
describe Github, 'invocations' do
6+
7+
context 'repo commits with sha' do
8+
let(:user) { "peter-murach" }
9+
let(:repo) { "github" }
10+
let(:sha) { "ceb66b61264657898cd6608c7e9ed78072169664" }
11+
12+
let(:request_path) { "/repos/#{user}/#{repo}/commits/#{sha}" }
13+
14+
before {
15+
stub_get(request_path).to_return(:body => nil, :status => 200,
16+
:headers => {:content_type => "application/json; charset=utf-8"})
17+
}
18+
19+
it 'requests commit information twice' do
20+
subject.repos.commits.get user, repo, sha
21+
subject.repos.commits.get user, repo, sha
22+
a_get(request_path).should have_been_made.times(2)
23+
end
24+
end
25+
26+
context 'organization info' do
27+
let(:org) { "thoughtbot" }
28+
29+
let(:request_path) { "/orgs/#{org}" }
30+
31+
before {
32+
stub_get(request_path).to_return(:body => nil, :status => 200,
33+
:headers => {:content_type => "application/json; charset=utf-8"})
34+
}
35+
36+
it 'requests organization information twice' do
37+
subject.orgs.get org
38+
subject.orgs.get org
39+
a_get(request_path).should have_been_made.times(2)
40+
end
41+
end
42+
end

0 commit comments

Comments
 (0)