Sha256: dcdf85cc6dc6d545df09be7c43b93aa711289fb242acbaf9355e750d8000679f

Contents?: true

Size: 1.13 KB

Versions: 68

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe FbGraph::OpenGraph::UserContext do
  let(:me) { FbGraph::User.me('access_token') }
  let(:app) { FbGraph::Application.new('app_id', :namespace => 'fbgraphsample') }

  describe '#og_actions' do
    it 'should return an array of FbGraph::OpenGraph::Action' do
      mock_graph :get, 'me/fbgraphsample:custom_action', 'open_graph/custom_actions', :access_token => 'access_token' do
        actions = me.og_actions(
          app.og_action('custom_action')
        )
        actions.each do |action|
          action.should be_instance_of FbGraph::OpenGraph::Action
        end
      end
    end
  end

  describe '#og_action!' do
    it 'should return FbGraph::OpenGraph::Action' do
      mock_graph :post, 'me/fbgraphsample:custom_action', 'open_graph/created', :access_token => 'access_token', :params => {
        :custom_object => 'http://samples.ogp.me/264755040233381'
      } do
        action = me.og_action!(
          app.og_action(:custom_action),
          :custom_object => 'http://samples.ogp.me/264755040233381'
        )
        action.should be_instance_of FbGraph::OpenGraph::Action
      end
    end
  end
end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
fb_graph-2.7.17 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.16 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.15 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.14 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.13 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.12 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.11 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.10 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.9 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.8 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.7 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.6 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.5 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.4 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.3 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.2 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.1 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.7.0 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.6.7 spec/fb_graph/open_graph/user_context_spec.rb
fb_graph-2.6.6 spec/fb_graph/open_graph/user_context_spec.rb