Sha256: 14beabd4ff7824f4ea978fe560f4c952c261e5ea948ed630308f18051c93b40f

Contents?: true

Size: 593 Bytes

Versions: 2

Compression:

Stored size: 593 Bytes

Contents

require File.dirname(__FILE__) + '/spec_helper'

describe "Warden::Github" do
  it "requesting an url that requires authentication redirects to github" do
    response = get "/"

    uri = Addressable::URI.parse(response.headers["Location"])

    uri.scheme.should eql('https')
    uri.host.should eql('github.com')

    params = uri.query_values
    params['response_type'].should eql('code')
    params['scope'].should eql('user,public_repo,repo,gist')
    params['client_id'].should match(/\w{20}/)
    params['redirect_uri'].should eql('http://example.org/auth/github/callback')
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
warden-github-0.2.0 spec/oauth_spec.rb
warden-github-0.1.2 spec/oauth_spec.rb