notes about failing spec in auth handshake

This commit is contained in:
Sven Fuchs 2014-06-21 16:26:38 +02:00
parent 58ce449ca4
commit 7643a253fa
2 changed files with 4 additions and 2 deletions

View File

@ -276,8 +276,8 @@ class Travis::Api::App
user
end
def get_token(endoint, values)
response = Faraday.new(ssl: Travis.config.github.ssl).post(endoint, values)
def get_token(endpoint, values)
response = Faraday.new(ssl: Travis.config.github.ssl).post(endpoint, values)
parameters = Addressable::URI.form_unencode(response.body)
token_info = parameters.assoc("access_token")
halt 401, 'could not resolve github token' unless token_info

View File

@ -75,6 +75,8 @@ describe Travis::Api::App::Endpoint::Authorization do
User::Oauth.instance_variable_set("@wanted_scopes", nil)
end
# in endpoint/authorization.rb 271, get_token faraday raises the exception:
# hostname "foobar.com" does not match the server certificate
it 'redirects to insufficient access page' do
response = get '/auth/handshake?state=github-state&code=oauth-code'
response.should redirect_to('https://travis-ci.org/insufficient_access')