Sha256: 2521c32fdeb78da0740ba68545bf5afa6d7804a0000943ffad488a811b2a207c

Contents?: true

Size: 886 Bytes

Versions: 24

Compression:

Stored size: 886 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Github::Scopes, '#list' do
  let(:request_path) { "/user" }
  let(:body) { '[]' }
  let(:status) { 200 }
  let(:accepted_scopes) { "delete_repo, repo, public_repo, repo:status" }
  let(:scopes) { 'repo' }

  before {
    subject.oauth_token = OAUTH_TOKEN
    stub_get(request_path).
      with(:query => { :access_token => "#{OAUTH_TOKEN}"}).
      to_return(:body => body, :status => status,
        :headers => {:content_type => "application/json; charset=utf-8",
'x-accepted-oauth-scopes' => accepted_scopes, 'x-oauth-scopes' => 'repo'
      })
  }

  after { reset_authentication_for(subject) }

  it 'performs request' do
    subject.list
    a_get(request_path).with(:query => {:access_token => OAUTH_TOKEN}).
      should have_been_made
  end

  it 'queries oauth header' do
    subject.list.should == [scopes]
  end
end # list

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
github_api-0.11.3 spec/github/scopes/list_spec.rb
github_api-0.11.2 spec/github/scopes/list_spec.rb
github_api-0.11.1 spec/github/scopes/list_spec.rb
github_api-0.11.0 spec/github/scopes/list_spec.rb
github_api-0.10.2 spec/github/scopes/list_spec.rb
github_api-0.10.1 spec/github/scopes/list_spec.rb
github_api-0.10.0 spec/github/scopes/list_spec.rb
github_api-0.9.7 spec/github/scopes/list_spec.rb
github_api-0.9.6 spec/github/scopes/list_spec.rb
github_api-0.9.5 spec/github/scopes/list_spec.rb
github_api-0.9.4 spec/github/scopes/list_spec.rb
github_api-0.9.3 spec/github/scopes/list_spec.rb
github_api-0.9.2 spec/github/scopes/list_spec.rb
github_api-0.9.1 spec/github/scopes/list_spec.rb
github_api-0.9.0 spec/github/scopes/list_spec.rb
github_api-0.8.11 spec/github/scopes/list_spec.rb
github_api-0.8.10 spec/github/scopes/list_spec.rb
github_api-0.8.9 spec/github/scopes/list_spec.rb
github_api-0.8.8 spec/github/scopes/list_spec.rb
github_api-0.8.7 spec/github/scopes/list_spec.rb