Sha256: 3e76e134a8e1d043d2aed79981dadd042780aaa0f3ccfa242af7d120195479c2

Contents?: true

Size: 1.32 KB

Versions: 29

Compression:

Stored size: 1.32 KB

Contents

require 'spec_helper'

describe FbGraph::Page do
  let(:attributes) do
    {
      :id       => '19292868552',
      :category => 'Technology',
      :likes    => 578246,
      :name     => 'Facebook Platform',
      :username => 'platform'
    }
  end
  subject do
    FbGraph::Page.new(attributes[:id], attributes)
  end

  its(:identifier) { should == attributes[:id]       }
  its(:category)   { should == attributes[:category] }
  its(:like_count) { should == attributes[:likes]    }
  its(:name)       { should == attributes[:name]     }
  its(:username)   { should == attributes[:username] }

  describe '.fetch' do
    subject do
      mock_graph :get, 'platform', 'pages/platform_public' do
        FbGraph::Page.fetch('platform')
      end
    end
    its(:identifier) { should == '19292868552' }
    its(:name)       { should == 'Facebook Platform' }
    its(:category)   { should == 'Technology' }
    its(:like_count) { should == 578214 }

    context 'when access_token field fetched' do
      subject do
        mock_graph :get, 'my_page', 'pages/with_token', :access_token => 'user_token', :params => {
          :fields => :access_token
        } do
          FbGraph::Page.fetch('my_page', :fields => :access_token, :access_token => 'user_token')
        end
      end
      its(:access_token) { should == 'page_token' }
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
fb_graph-2.2.2 spec/fb_graph/page_spec.rb
fb_graph-2.2.1 spec/fb_graph/page_spec.rb
fb_graph-2.2.0 spec/fb_graph/page_spec.rb
fb_graph-2.2.0.beta spec/fb_graph/page_spec.rb
fb_graph-2.2.0.alpha2 spec/fb_graph/page_spec.rb
fb_graph-2.2.0.alpha spec/fb_graph/page_spec.rb
fb_graph-2.1.13 spec/fb_graph/page_spec.rb
fb_graph-2.1.12 spec/fb_graph/page_spec.rb
fb_graph-2.1.11 spec/fb_graph/page_spec.rb
fb_graph-2.1.10 spec/fb_graph/page_spec.rb
fb_graph-2.1.9 spec/fb_graph/page_spec.rb
fb_graph-2.1.8 spec/fb_graph/page_spec.rb
fb_graph-2.1.7 spec/fb_graph/page_spec.rb
fb_graph-2.1.6 spec/fb_graph/page_spec.rb
fb_graph-2.1.5 spec/fb_graph/page_spec.rb
fb_graph-2.1.4 spec/fb_graph/page_spec.rb
fb_graph-2.1.3 spec/fb_graph/page_spec.rb
fb_graph-2.1.2 spec/fb_graph/page_spec.rb
fb_graph-2.1.1 spec/fb_graph/page_spec.rb
fb_graph-2.1.0 spec/fb_graph/page_spec.rb