Sha256: db97a2402fb4f4f324c1e2350772c79a68b58ad3f28c82201067abe8fdb653d4

Contents?: true

Size: 1.67 KB

Versions: 24

Compression:

Stored size: 1.67 KB

Contents

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

describe FbGraph::Connections::Posts, '#posts' do
  context 'when included by FbGraph::User' do
    before do
      fake_json(:get, 'arjun/posts', 'users/posts/arjun_public')
      fake_json(:get, 'arjun/posts?access_token=access_token', 'users/posts/arjun_private')
    end

    context 'when no access_token given' do
      it 'should return public posts the user created as FbGraph::Post' do
        posts = FbGraph::User.new('arjun').posts
        posts.first.should == FbGraph::Post.new(
          '7901103_121392141207495',
          :from => {
            :id => '7901103',
            :name => 'Arjun Banker'
          },
          :picture => 'http://external.ak.fbcdn.net/safe_image.php?d=d2cc5beedaa401ba54eccc9014647285&w=130&h=130&url=http%3A%2F%2Fimages.ted.com%2Fimages%2Fted%2F269_389x292.jpg',
          :link => 'http://www.ted.com/talks/wade_davis_on_endangered_cultures.html',
          :name => 'Wade Davis on endangered cultures | Video on TED.com',
          :caption => 'www.ted.com',
          :description => 'TED Talks With stunning photos and stories, National Geographic Explorer Wade Davis celebrates the extraordinary diversity of the world\'s indigenous cultures, which are disappearing from the planet at an alarming rate.',
          :icon => 'http://static.ak.fbcdn.net/rsrc.php/z9XZ8/hash/976ulj6z.gif',
          :created_time => '2010-04-25T04:05:32+0000',
          :updated_time => '2010-04-25T04:05:32+0000',
          :privacy => {
            :value => 'EVERYONE'
          }
        )
        posts.each do |post|
          post.should be_instance_of(FbGraph::Post)
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
fb_graph-1.7.0 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.7.0.alpha2 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.9 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.7.0.alpha spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.8 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.7 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.5 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.4 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.3 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.2 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.1 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.6.0 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.5.5 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.5.4 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.5.3 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.5.2 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.5.1 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.5.0 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.4.1 spec/fb_graph/connections/posts_spec.rb
fb_graph-1.4.0 spec/fb_graph/connections/posts_spec.rb