Sha256: 10089cfe37ca8cbed1b8adb54581b9c7f47feee7e24cbd0f11d352dd37de00b6

Contents?: true

Size: 1.16 KB

Versions: 4

Compression:

Stored size: 1.16 KB

Contents

require 'spec_helper'

describe FbGraph::Connections::Links, '#links' do
  context 'when included by FbGraph::User' do
    it 'should return notes as FbGraph::Link' do
      mock_graph :get, 'matake/links', 'users/links/matake_private', :params => {
        :access_token => 'access_token'
      } do
        links = FbGraph::User.new('matake', :access_token => 'access_token').links
        links.each do |link|
          link.should be_instance_of(FbGraph::Link)
        end
      end
    end
  end
end

describe FbGraph::Connections::Links, '#link!' do
  context 'when included by FbGraph::User' do
    it 'should return generated link' do
      mock_graph :post, 'matake/links', 'users/links/post_with_valid_access_token' do
        link = FbGraph::User.new('matake', :access_token => 'valid').link!(
          :link => 'http://github.com/nov/fb_graph',
          :message => 'A Ruby wrapper for Facebook Graph API.'
        )
        link.identifier.should == 120765121284251
        link.link.should == 'http://github.com/nov/fb_graph'
        link.message.should == 'A Ruby wrapper for Facebook Graph API.'
        link.access_token.should == 'valid'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fb_graph-1.7.5 spec/fb_graph/connections/links_spec.rb
fb_graph-1.7.4 spec/fb_graph/connections/links_spec.rb
fb_graph-1.7.3 spec/fb_graph/connections/links_spec.rb
fb_graph-1.7.2 spec/fb_graph/connections/links_spec.rb