Sha256: ed69b2987f9567d8b17918f9274653b104f697675d3cf5878654eacc39892dbc

Contents?: true

Size: 975 Bytes

Versions: 25

Compression:

Stored size: 975 Bytes

Contents

require File.join(File.dirname(__FILE__), '../spec_helper')

describe FbGraph::Auth, '.new' do

  it 'should setup OAuth2::Client' do
    auth = FbGraph::Auth.new('client_id', 'client_secret')
    auth.client.should be_a(OAuth2::Client)
    auth.client.id.should            == 'client_id'
    auth.client.secret.should == 'client_secret'
  end

  context 'when invalid cookie given' do
    it 'should raise FbGraph::VerificationFailed' do
      lambda do
        FbGraph::Auth.new('client_id', 'client_secret', :cookie => 'invalid')
      end.should raise_exception(FbGraph::Auth::VerificationFailed)
    end
  end

end

describe FbGraph::Auth, '.from_cookie' do
  before do
    @auth = FbGraph::Auth.new('client_id', 'client_secret')
  end

  context 'when invalid cookie given' do
    it 'should raise FbGraph::VerificationFailed' do
      lambda do
        @auth.from_cookie('invalid')
      end.should raise_exception(FbGraph::Auth::VerificationFailed)
    end
  end

end

Version data entries

25 entries across 25 versions & 2 rubygems

Version Path
fb_graph-1.2.3 spec/fb_graph/auth_spec.rb
fb_graph-1.2.2 spec/fb_graph/auth_spec.rb
fb_graph-1.2.1 spec/fb_graph/auth_spec.rb
fb_graph-1.2.0 spec/fb_graph/auth_spec.rb
fb_graph-1.1.7 spec/fb_graph/auth_spec.rb
fb_graph-1.1.6 spec/fb_graph/auth_spec.rb
fb_graph-1.1.5 spec/fb_graph/auth_spec.rb
fb_graph-1.1.4 spec/fb_graph/auth_spec.rb
fb_graph-1.1.3 spec/fb_graph/auth_spec.rb
fb_graph-1.1.2 spec/fb_graph/auth_spec.rb
fb_graph-1.1.1 spec/fb_graph/auth_spec.rb
fb_graph-1.1.0 spec/fb_graph/auth_spec.rb
fb_graph-1.0.7 spec/fb_graph/auth_spec.rb
fb_graph-1.0.6 spec/fb_graph/auth_spec.rb
fb_graph-1.0.5 spec/fb_graph/auth_spec.rb
palidanx-fb_graph-1.0.4 spec/fb_graph/auth_spec.rb
fb_graph-1.0.4 spec/fb_graph/auth_spec.rb
fb_graph-1.0.3 spec/fb_graph/auth_spec.rb
fb_graph-1.0.2 spec/fb_graph/auth_spec.rb
fb_graph-1.0.1 spec/fb_graph/auth_spec.rb