Sha256: 1be1a86bd8bf4aa3988074d5d5b19f6a5dea27833e883f103a8c42449882d9ba

Contents?: true

Size: 1.21 KB

Versions: 1

Compression:

Stored size: 1.21 KB

Contents

require 'spec_helper'

describe FbGraph::Application, '.new' do
  it 'should setup all supported attributes' do
    attributes = {
      :id          => '12345',
      :name        => 'FbGraph',
      :description => 'Owsome Facebook Graph Wrapper',
      :category    => 'Programming',
      :link        => 'http://github.com/nov/fb_graph',
      :secret      => 'sec sec'
    }
    app = FbGraph::Application.new(attributes.delete(:id), attributes)
    app.identifier.should  == '12345'
    app.name.should        == 'FbGraph'
    app.description.should == 'Owsome Facebook Graph Wrapper'
    app.category.should    == 'Programming'
    app.link.should        == 'http://github.com/nov/fb_graph'
    app.secret.should      == 'sec sec'
  end
end

describe FbGraph::Application, '.get_access_token' do
  before do
    fake_json :post, 'oauth/access_token', 'token_response'
    @app = FbGraph::Application.new('client_id', :secret => 'client_secret')
  end

  it 'should POST oauth/token' do
    @app.access_token.should be_nil
    @app.get_access_token
    @app.access_token.should be_instance_of(Rack::OAuth2::AccessToken::Legacy)
    @app.access_token.access_token.should == 'token'
  end

  after do
    FakeWeb.clean_registry
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fb_graph-1.7.1 spec/fb_graph/application_spec.rb