Sha256: 74ec13984e215ab9b918b54f126a38ebba213bcc730255bea3aa2138af60a313

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

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

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

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

    expect(uri.scheme).to eq 'http'
    expect(uri.host).to eq 'localhost'

    params = uri.query_values
    expect(params['response_type']).to eq 'code'
    expect(params['scope']).to eq 'public'
    expect(params['client_id']).to match(/\w{20}/)
    expect(params['redirect_uri']).to eq 'http://example.org/auth/oauthed/callback'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
warden-oauthed-0.0.4 spec/oauth_spec.rb