Sha256: 46d7bb89337feed833f26ce9db1a1af56c8b341fd8918105049af2eee52468c8

Contents?: true

Size: 930 Bytes

Versions: 1

Compression:

Stored size: 930 Bytes

Contents

require 'spec_helper'

describe "OmniAuth::Strategies::Mendeley" do
  subject do
    OmniAuth::Strategies::Mendeley.new(nil, @options || {})
  end

  context 'client options' do
    it 'has correct Mendeley site' do
      subject.options.client_options.site.should eq('https://api.mendeley.com')
    end

    it 'has correct request token path' do
      subject.options.client_options.request_token_path.should eq('/oauth/request_token/')
    end

    it 'has correct access token path' do
      subject.options.client_options.access_token_path.should eq('/oauth/access_token/')
    end

    it 'has correct authorize path' do
      subject.options.client_options.authorize_path.should eq('/oauth/authorize/')
    end
  end

  context '#uid' do
    before :each do
      subject.stub(:user_data) { { 'profile_id' => '123' } }
    end

    it 'returns the id from user_data' do
      subject.uid.should eq('123')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
omniauth-mendeley-0.2 spec/omniauth/strategies/mendeley_spec.rb