Sha256: 64812124e98754a370f439e43a5a051a7eb8ea9d2f9fdddde3d01e2bc47304ea

Contents?: true

Size: 743 Bytes

Versions: 1

Compression:

Stored size: 743 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/helper')
require 'webmock/rspec'

describe "Github" do
  it 'should return raise error if initialized without token' do
    expect do
      Github.new()
    end.to raise_error(ArgumentError)
  end

  context 'after initialization with token' do
    subject{Github.new(access_token: 'token')}
    it 'should return the authentication token after initialization' do
      subject.access_token.should eq('token')
    end
    it "should load the current user\'s information" do
      stub_request(:get, "https://api.github.com/user?access_token=token")
        .to_return(body: {user: {username: 'uname'}}, status: 200)
      subject.user.should eq(user: {username: 'uname'})
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
git-layer-0.1.0 spec/git-layer_spec.rb