Sha256: b66dc191ccc8cdcd526344c7bccd864f431104ad34f80f9650fc3831ef56f0a7

Contents?: true

Size: 1.03 KB

Versions: 69

Compression:

Stored size: 1.03 KB

Contents

require 'spec_helper'

describe FbGraph::OpenGraph::ApplicationContext do
  let :application_with_namespace do
    FbGraph::Application.new('app_id', :namespace => 'fbgraph')
  end
  let :application_without_namespace do
    FbGraph::Application.new('app_id')
  end

  describe '#og_action' do
    context 'with namespace' do
      it 'should return "APP_NAMESPACE:ACTION_NAME" without fetching application info' do
        application_with_namespace.og_action('action_name').should == 'fbgraph:action_name'
        application_with_namespace.og_action(:action_name).should == 'fbgraph:action_name'
      end
    end

    context 'without namespace' do
      it 'should return "APP_NAMESPACE:ACTION_NAME" with fetching application info' do
        mock_graph :get, 'app_id', 'applications/fbgraphsample' do
          application_without_namespace.og_action('action_name').should == 'fbgraphsample:action_name'
          application_without_namespace.og_action(:action_name).should == 'fbgraphsample:action_name'
        end
      end
    end
  end
end

Version data entries

69 entries across 69 versions & 1 rubygems

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