File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments