Skip to content

Commit

Permalink
Merged pull request #24 from ctshryock/auth_password_test.
Browse files Browse the repository at this point in the history
Add test to cover basic auth, username:password
  • Loading branch information
sferik committed Apr 30, 2011
2 parents 37847e4 + afb90ba commit 571f26e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spec/octokit/client_spec.rb
Expand Up @@ -27,4 +27,12 @@
}.should_not raise_exception
end

it 'should work with basic auth and password' do
stub_request(:get, "https://foo:bar@github.com/api/v2/json/commits/list/baz/quux/master").
with(:headers => {'Accept'=>'*/*', 'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent'=>'Ruby'}).
to_return(:status => 200, :body => '{"commits":[]}', :headers => {})
proc {
Octokit::Client.new(:login => 'foo', :password => 'bar').commits('baz/quux')
}.should_not raise_exception
end
end

0 comments on commit 571f26e

Please sign in to comment.